[PATCH 1/2] nvram: Drop the BKL from nvram_open()

From: Ingo Molnar
Date: Wed Oct 14 2009 - 11:48:38 EST


It's safe to remove the BKL from nvram_open(): there's no open()
versus read() races: nvram_init() is very simple and race-free,
it registers the device then puts it into /proc - there's no
state init to race with.

Cc: Wim Van Sebroeck <wim@xxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
LKML-Reference: <1255116426-7270-1-git-send-email-fweisbec@xxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
drivers/char/nvram.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 88cee40..740e356 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -331,14 +331,12 @@ static int nvram_ioctl(struct inode *inode, struct file *file,

static int nvram_open(struct inode *inode, struct file *file)
{
- lock_kernel();
spin_lock(&nvram_state_lock);

if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
(nvram_open_mode & NVRAM_EXCL) ||
((file->f_mode & FMODE_WRITE) && (nvram_open_mode & NVRAM_WRITE))) {
spin_unlock(&nvram_state_lock);
- unlock_kernel();
return -EBUSY;
}

@@ -349,7 +347,6 @@ static int nvram_open(struct inode *inode, struct file *file)
nvram_open_cnt++;

spin_unlock(&nvram_state_lock);
- unlock_kernel();

return 0;
}
--
1.6.5.2