Merge branch 'parisc-4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc fixes and cleanups from Helge Deller:
 "Nothing really important in this patchset: fix resource leaks in error
  paths, coding style cleanups and code removal"

* 'parisc-4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Remove flush_user_dcache_range and flush_user_icache_range
  parisc: fix a printk
  parisc: ccio-dma: Handle return NULL error from ioremap_nocache
  parisc: Define access_ok() as macro
  parisc: eisa: Fix resource leaks in error paths
  parisc: eisa: Remove coding style errors
This commit is contained in:
Linus Torvalds 2017-03-03 16:20:06 -08:00
commit f47e2db43d
7 changed files with 83 additions and 88 deletions

View File

@ -27,8 +27,6 @@ void flush_user_dcache_range_asm(unsigned long, unsigned long);
void flush_kernel_dcache_range_asm(unsigned long, unsigned long); void flush_kernel_dcache_range_asm(unsigned long, unsigned long);
void flush_kernel_dcache_page_asm(void *); void flush_kernel_dcache_page_asm(void *);
void flush_kernel_icache_page(void *); void flush_kernel_icache_page(void *);
void flush_user_dcache_range(unsigned long, unsigned long);
void flush_user_icache_range(unsigned long, unsigned long);
/* Cache flush operations */ /* Cache flush operations */

View File

@ -32,11 +32,7 @@
* that put_user is the same as __put_user, etc. * that put_user is the same as __put_user, etc.
*/ */
static inline long access_ok(int type, const void __user * addr, #define access_ok(type, uaddr, size) (1)
unsigned long size)
{
return 1;
}
#define put_user __put_user #define put_user __put_user
#define get_user __get_user #define get_user __get_user

View File

@ -574,24 +574,6 @@ void flush_cache_mm(struct mm_struct *mm)
} }
} }
void
flush_user_dcache_range(unsigned long start, unsigned long end)
{
if ((end - start) < parisc_cache_flush_threshold)
flush_user_dcache_range_asm(start,end);
else
flush_data_cache();
}
void
flush_user_icache_range(unsigned long start, unsigned long end)
{
if ((end - start) < parisc_cache_flush_threshold)
flush_user_icache_range_asm(start,end);
else
flush_instruction_cache();
}
void flush_cache_range(struct vm_area_struct *vma, void flush_cache_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end) unsigned long start, unsigned long end)
{ {

View File

@ -233,6 +233,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs,
struct rt_sigframe __user *frame; struct rt_sigframe __user *frame;
unsigned long rp, usp; unsigned long rp, usp;
unsigned long haddr, sigframe_size; unsigned long haddr, sigframe_size;
unsigned long start, end;
int err = 0; int err = 0;
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
struct compat_rt_sigframe __user * compat_frame; struct compat_rt_sigframe __user * compat_frame;
@ -300,10 +301,10 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs,
} }
#endif #endif
flush_user_dcache_range((unsigned long) &frame->tramp[0], start = (unsigned long) &frame->tramp[0];
(unsigned long) &frame->tramp[TRAMP_SIZE]); end = (unsigned long) &frame->tramp[TRAMP_SIZE];
flush_user_icache_range((unsigned long) &frame->tramp[0], flush_user_dcache_range_asm(start, end);
(unsigned long) &frame->tramp[TRAMP_SIZE]); flush_user_icache_range_asm(start, end);
/* TRAMP Words 0-4, Length 5 = SIGRESTARTBLOCK_TRAMP /* TRAMP Words 0-4, Length 5 = SIGRESTARTBLOCK_TRAMP
* TRAMP Words 5-9, Length 4 = SIGRETURN_TRAMP * TRAMP Words 5-9, Length 4 = SIGRETURN_TRAMP
@ -549,8 +550,8 @@ insert_restart_trampoline(struct pt_regs *regs)
WARN_ON(err); WARN_ON(err);
/* flush data/instruction cache for new insns */ /* flush data/instruction cache for new insns */
flush_user_dcache_range(start, end); flush_user_dcache_range_asm(start, end);
flush_user_icache_range(start, end); flush_user_icache_range_asm(start, end);
regs->gr[31] = regs->gr[30] + 8; regs->gr[31] = regs->gr[30] + 8;
return; return;

View File

@ -239,7 +239,7 @@ show_signal_msg(struct pt_regs *regs, unsigned long code,
vma ? ',':'\n'); vma ? ',':'\n');
if (vma) if (vma)
pr_warn(KERN_CONT " vm_start = 0x%08lx, vm_end = 0x%08lx\n", pr_cont(" vm_start = 0x%08lx, vm_end = 0x%08lx\n",
vma->vm_start, vma->vm_end); vma->vm_start, vma->vm_end);
show_regs(regs); show_regs(regs);

View File

@ -1539,7 +1539,7 @@ static int __init ccio_probe(struct parisc_device *dev)
ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL); ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
if (ioc == NULL) { if (ioc == NULL) {
printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
return 1; return -ENOMEM;
} }
ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn"; ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";
@ -1554,6 +1554,10 @@ static int __init ccio_probe(struct parisc_device *dev)
ioc->hw_path = dev->hw_path; ioc->hw_path = dev->hw_path;
ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096); ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096);
if (!ioc->ioc_regs) {
kfree(ioc);
return -ENOMEM;
}
ccio_ioc_init(ioc); ccio_ioc_init(ioc);
ccio_init_resources(ioc); ccio_init_resources(ioc);
hppa_dma_ops = &ccio_ops; hppa_dma_ops = &ccio_ops;

View File

@ -334,7 +334,7 @@ static int __init eisa_probe(struct parisc_device *dev)
result = request_irq(dev->irq, eisa_irq, IRQF_SHARED, "EISA", &eisa_dev); result = request_irq(dev->irq, eisa_irq, IRQF_SHARED, "EISA", &eisa_dev);
if (result) { if (result) {
printk(KERN_ERR "EISA: request_irq failed!\n"); printk(KERN_ERR "EISA: request_irq failed!\n");
return result; goto error_release;
} }
/* Reserve IRQ2 */ /* Reserve IRQ2 */
@ -358,6 +358,11 @@ static int __init eisa_probe(struct parisc_device *dev)
} }
} }
eisa_eeprom_addr = ioremap_nocache(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH); eisa_eeprom_addr = ioremap_nocache(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH);
if (!eisa_eeprom_addr) {
result = -ENOMEM;
printk(KERN_ERR "EISA: ioremap_nocache failed!\n");
goto error_free_irq;
}
result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space, result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space,
&eisa_dev.hba.lmmio_space); &eisa_dev.hba.lmmio_space);
init_eisa_pic(); init_eisa_pic();
@ -372,11 +377,20 @@ static int __init eisa_probe(struct parisc_device *dev)
eisa_dev.root.dma_mask = 0xffffffff; /* wild guess */ eisa_dev.root.dma_mask = 0xffffffff; /* wild guess */
if (eisa_root_register (&eisa_dev.root)) { if (eisa_root_register (&eisa_dev.root)) {
printk(KERN_ERR "EISA: Failed to register EISA root\n"); printk(KERN_ERR "EISA: Failed to register EISA root\n");
return -1; result = -ENOMEM;
goto error_iounmap;
} }
} }
return 0; return 0;
error_iounmap:
iounmap(eisa_eeprom_addr);
error_free_irq:
free_irq(dev->irq, &eisa_dev);
error_release:
release_resource(&eisa_dev.hba.io_space);
return result;
} }
static const struct parisc_device_id eisa_tbl[] = { static const struct parisc_device_id eisa_tbl[] = {