[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1255116030-6929-1-git-send-email-fweisbec@gmail.com>
Date: Fri, 9 Oct 2009 21:20:30 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...e.hu>, John Kacur <jkacur@...hat.com>,
Sven-Thorsten Dietrich <sven@...bigcorporation.com>,
Jonathan Corbet <corbet@....net>,
Alessio Igor Bogani <abogani@...ware.it>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Greg KH <gregkh@...e.de>
Subject: [PATCH] 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.
(Is this file still used? I can't even build it,
looks like it is built under CONFIG_GENERIC_NVRAM but this
option is referenced nowhere except in powerpc defconfigs)
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: John Kacur <jkacur@...hat.com>
Cc: Sven-Thorsten Dietrich <sven@...bigcorporation.com>
Cc: Jonathan Corbet <corbet@....net>
Cc: Alessio Igor Bogani <abogani@...ware.it>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Greg KH <gregkh@...e.de>
---
drivers/char/generic_nvram.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c
index ef31738..c49200e 100644
--- a/drivers/char/generic_nvram.c
+++ b/drivers/char/generic_nvram.c
@@ -32,7 +32,6 @@ static ssize_t nvram_len;
static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
{
- lock_kernel();
switch (origin) {
case 1:
offset += file->f_pos;
@@ -41,12 +40,11 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
offset += nvram_len;
break;
}
- if (offset < 0) {
- unlock_kernel();
+ if (offset < 0)
return -EINVAL;
- }
+
file->f_pos = offset;
- unlock_kernel();
+
return file->f_pos;
}
--
1.6.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists