aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/generic_nvram.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-10-09 15:20:30 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-10-14 11:36:49 -0400
commit6783b9cd7104470a3afab51c205c5aea53a2858f (patch)
tree461b15ff61a7c737e2fef8af8db928c4ae4e7798 /drivers/char/generic_nvram.c
parent205153aa40b7fb36dc7fe76c1798584ace55b288 (diff)
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: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <1255116030-6929-1-git-send-email-fweisbec@gmail.com> Cc: Greg KH <gregkh@suse.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/char/generic_nvram.c')
-rw-r--r--drivers/char/generic_nvram.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c
index ef31738c2cbe..fda4181b5e67 100644
--- a/drivers/char/generic_nvram.c
+++ b/drivers/char/generic_nvram.c
@@ -19,7 +19,6 @@
19#include <linux/miscdevice.h> 19#include <linux/miscdevice.h>
20#include <linux/fcntl.h> 20#include <linux/fcntl.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/smp_lock.h>
23#include <asm/uaccess.h> 22#include <asm/uaccess.h>
24#include <asm/nvram.h> 23#include <asm/nvram.h>
25#ifdef CONFIG_PPC_PMAC 24#ifdef CONFIG_PPC_PMAC
@@ -32,7 +31,6 @@ static ssize_t nvram_len;
32 31
33static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) 32static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
34{ 33{
35 lock_kernel();
36 switch (origin) { 34 switch (origin) {
37 case 1: 35 case 1:
38 offset += file->f_pos; 36 offset += file->f_pos;
@@ -41,12 +39,11 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
41 offset += nvram_len; 39 offset += nvram_len;
42 break; 40 break;
43 } 41 }
44 if (offset < 0) { 42 if (offset < 0)
45 unlock_kernel();
46 return -EINVAL; 43 return -EINVAL;
47 } 44
48 file->f_pos = offset; 45 file->f_pos = offset;
49 unlock_kernel(); 46
50 return file->f_pos; 47 return file->f_pos;
51} 48}
52 49