提交 3307f19f 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc: remove some pointless conditionals before kfree()
  sbus: changed ioctls to unlocked
  sparc: asm/atomic.h on 32bit should include asm/system.h for xchg
  sparc64: Fix smp_callin() locking.
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm/system.h>
#define ATOMIC_INIT(i) { (i) } #define ATOMIC_INIT(i) { (i) }
extern int __atomic_add_return(int, atomic_t *); extern int __atomic_add_return(int, atomic_t *);
......
...@@ -1183,8 +1183,7 @@ struct ldc_channel *ldc_alloc(unsigned long id, ...@@ -1183,8 +1183,7 @@ struct ldc_channel *ldc_alloc(unsigned long id,
free_queue(lp->tx_num_entries, lp->tx_base); free_queue(lp->tx_num_entries, lp->tx_base);
out_free_mssbuf: out_free_mssbuf:
if (mssbuf) kfree(mssbuf);
kfree(mssbuf);
out_free_iommu: out_free_iommu:
ldc_iommu_release(lp); ldc_iommu_release(lp);
...@@ -1217,8 +1216,7 @@ void ldc_free(struct ldc_channel *lp) ...@@ -1217,8 +1216,7 @@ void ldc_free(struct ldc_channel *lp)
hlist_del(&lp->list); hlist_del(&lp->list);
if (lp->mssbuf) kfree(lp->mssbuf);
kfree(lp->mssbuf);
ldc_iommu_release(lp); ldc_iommu_release(lp);
......
...@@ -118,9 +118,9 @@ void __cpuinit smp_callin(void) ...@@ -118,9 +118,9 @@ void __cpuinit smp_callin(void)
while (!cpu_isset(cpuid, smp_commenced_mask)) while (!cpu_isset(cpuid, smp_commenced_mask))
rmb(); rmb();
ipi_call_lock(); ipi_call_lock_irq();
cpu_set(cpuid, cpu_online_map); cpu_set(cpuid, cpu_online_map);
ipi_call_unlock(); ipi_call_unlock_irq();
/* idle thread is expected to have preempt disabled */ /* idle thread is expected to have preempt disabled */
preempt_disable(); preempt_disable();
......
...@@ -383,18 +383,22 @@ static int jsf_ioctl_program(void __user *arg) ...@@ -383,18 +383,22 @@ static int jsf_ioctl_program(void __user *arg)
return 0; return 0;
} }
static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd, static long jsf_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
unsigned long arg)
{ {
lock_kernel();
int error = -ENOTTY; int error = -ENOTTY;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN)) {
unlock_kernel();
return -EPERM; return -EPERM;
}
switch (cmd) { switch (cmd) {
case JSFLASH_IDENT: case JSFLASH_IDENT:
if (copy_to_user(argp, &jsf0.id, JSFIDSZ)) if (copy_to_user(argp, &jsf0.id, JSFIDSZ)) {
unlock_kernel();
return -EFAULT; return -EFAULT;
}
break; break;
case JSFLASH_ERASE: case JSFLASH_ERASE:
error = jsf_ioctl_erase(arg); error = jsf_ioctl_erase(arg);
...@@ -404,6 +408,7 @@ static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd, ...@@ -404,6 +408,7 @@ static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
break; break;
} }
unlock_kernel();
return error; return error;
} }
...@@ -439,7 +444,7 @@ static const struct file_operations jsf_fops = { ...@@ -439,7 +444,7 @@ static const struct file_operations jsf_fops = {
.llseek = jsf_lseek, .llseek = jsf_lseek,
.read = jsf_read, .read = jsf_read,
.write = jsf_write, .write = jsf_write,
.ioctl = jsf_ioctl, .unlocked_ioctl = jsf_ioctl,
.mmap = jsf_mmap, .mmap = jsf_mmap,
.open = jsf_open, .open = jsf_open,
.release = jsf_release, .release = jsf_release,
......
...@@ -197,9 +197,8 @@ static struct uctrl_driver { ...@@ -197,9 +197,8 @@ static struct uctrl_driver {
static void uctrl_get_event_status(struct uctrl_driver *); static void uctrl_get_event_status(struct uctrl_driver *);
static void uctrl_get_external_status(struct uctrl_driver *); static void uctrl_get_external_status(struct uctrl_driver *);
static int static long
uctrl_ioctl(struct inode *inode, struct file *file, uctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
unsigned int cmd, unsigned long arg)
{ {
switch (cmd) { switch (cmd) {
default: default:
...@@ -226,7 +225,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id) ...@@ -226,7 +225,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id)
static const struct file_operations uctrl_fops = { static const struct file_operations uctrl_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek, .llseek = no_llseek,
.ioctl = uctrl_ioctl, .unlocked_ioctl = uctrl_ioctl,
.open = uctrl_open, .open = uctrl_open,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册