X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Foprofile%2Foprofilefs.c;h=8543cb26cf34b8d8b861cb7cafd3388b5cf6a6f3;hb=7a13e932281e7042a592f4f14db0b348199e7aac;hp=5756401fb15bb2e13d272ef87f4ce6f3752ab8cd;hpb=12e36b2f41b6cbc67386fcb9c59c32a3e2033905;p=powerpc.git diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index 5756401fb1..8543cb26cf 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c @@ -65,6 +65,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t co int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count) { char tmpbuf[TMPBUFSIZE]; + unsigned long flags; if (!count) return 0; @@ -77,9 +78,9 @@ int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, siz if (copy_from_user(tmpbuf, buf, count)) return -EFAULT; - spin_lock(&oprofilefs_lock); + spin_lock_irqsave(&oprofilefs_lock, flags); *val = simple_strtoul(tmpbuf, NULL, 0); - spin_unlock(&oprofilefs_lock); + spin_unlock_irqrestore(&oprofilefs_lock, flags); return 0; } @@ -115,14 +116,14 @@ static int default_open(struct inode * inode, struct file * filp) } -static struct file_operations ulong_fops = { +static const struct file_operations ulong_fops = { .read = ulong_read_file, .write = ulong_write_file, .open = default_open, }; -static struct file_operations ulong_ro_fops = { +static const struct file_operations ulong_ro_fops = { .read = ulong_read_file, .open = default_open, }; @@ -182,7 +183,7 @@ static ssize_t atomic_read_file(struct file * file, char __user * buf, size_t co } -static struct file_operations atomic_ro_fops = { +static const struct file_operations atomic_ro_fops = { .read = atomic_read_file, .open = default_open, };