Commit 6783b9cd7104470a3afab51c205c5aea53a2858f
Committed by
Thomas Gleixner
1 parent
205153aa40
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 3 additions and 6 deletions Side-by-side Diff
drivers/char/generic_nvram.c
... | ... | @@ -19,7 +19,6 @@ |
19 | 19 | #include <linux/miscdevice.h> |
20 | 20 | #include <linux/fcntl.h> |
21 | 21 | #include <linux/init.h> |
22 | -#include <linux/smp_lock.h> | |
23 | 22 | #include <asm/uaccess.h> |
24 | 23 | #include <asm/nvram.h> |
25 | 24 | #ifdef CONFIG_PPC_PMAC |
... | ... | @@ -32,7 +31,6 @@ |
32 | 31 | |
33 | 32 | static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) |
34 | 33 | { |
35 | - lock_kernel(); | |
36 | 34 | switch (origin) { |
37 | 35 | case 1: |
38 | 36 | offset += file->f_pos; |
39 | 37 | |
40 | 38 | |
... | ... | @@ -41,12 +39,11 @@ |
41 | 39 | offset += nvram_len; |
42 | 40 | break; |
43 | 41 | } |
44 | - if (offset < 0) { | |
45 | - unlock_kernel(); | |
42 | + if (offset < 0) | |
46 | 43 | return -EINVAL; |
47 | - } | |
44 | + | |
48 | 45 | file->f_pos = offset; |
49 | - unlock_kernel(); | |
46 | + | |
50 | 47 | return file->f_pos; |
51 | 48 | } |
52 | 49 |