Commit 6783b9cd authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Thomas Gleixner

nvram: Drop the bkl from nvram_llseek()

There is nothing to protect inside nvram_llseek(), the file
offset doesn't need to be protected and nvram_len is only
initialized from an __init path.

It's safe to remove the big kernel lock there.
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1255116030-6929-1-git-send-email-fweisbec@gmail.com>
Cc: Greg KH <gregkh@suse.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 205153aa
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/nvram.h> #include <asm/nvram.h>
#ifdef CONFIG_PPC_PMAC #ifdef CONFIG_PPC_PMAC
...@@ -32,7 +31,6 @@ static ssize_t nvram_len; ...@@ -32,7 +31,6 @@ static ssize_t nvram_len;
static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
{ {
lock_kernel();
switch (origin) { switch (origin) {
case 1: case 1:
offset += file->f_pos; offset += file->f_pos;
...@@ -41,12 +39,11 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) ...@@ -41,12 +39,11 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
offset += nvram_len; offset += nvram_len;
break; break;
} }
if (offset < 0) { if (offset < 0)
unlock_kernel();
return -EINVAL; return -EINVAL;
}
file->f_pos = offset; file->f_pos = offset;
unlock_kernel();
return file->f_pos; return file->f_pos;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment