mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-kernel@vger.kernel.org
Cc: John Kacur <jkacur@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Jaroslav Kysela <perex@perex.cz>
Subject: [PATCH 6/8] isapnp: BKL removal
Date: Sun,  4 Jul 2010 00:02:30 +0200	[thread overview]
Message-ID: <1278194552-24943-7-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1278194552-24943-1-git-send-email-arnd@arndb.de>

Remove BKL use from isapnp_proc_bus_lseek(), like was done for
proc_bus_pci_lseek() a long time ago and recently for Zorro
by Geert Uytterhoeven.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jaroslav Kysela <perex@perex.cz>
---
 drivers/pnp/isapnp/proc.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index 3f94eda..4249999 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -31,8 +31,9 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL;
 static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
 {
 	loff_t new = -1;
+	struct inode *inode = file->f_path.dentry->d_inode;
 
-	lock_kernel();
+	mutex_lock(&inode->i_mutex);
 	switch (whence) {
 	case 0:
 		new = off;
@@ -45,11 +46,11 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
 		break;
 	}
 	if (new < 0 || new > 256) {
-		unlock_kernel();
-		return -EINVAL;
-	}
-	unlock_kernel();
-	return (file->f_pos = new);
+		new = -EINVAL;
+	else
+		file->f_pos = new;
+	mutex_unlock(&inode->i_mutex);
+	return new;
 }
 
 static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
-- 
1.7.1


  parent reply	other threads:[~2010-07-03 22:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-03 22:02 [PATCH 0/8] BKL removal, assorted patches Arnd Bergmann
2010-07-03 22:02 ` [PATCH 1/8] do_coredump: do not take BKL Arnd Bergmann
2010-07-09 23:25   ` Frederic Weisbecker
2010-07-03 22:02 ` [PATCH 2/8] init: remove the BKL from startup code Arnd Bergmann
2010-07-09  3:52   ` Frederic Weisbecker
2010-07-09 13:37   ` Frederic Weisbecker
2010-07-03 22:02 ` [PATCH 3/8] hpet: kill BKL, add compat_ioctl Arnd Bergmann
2010-07-03 22:02 ` [PATCH 4/8] proc/pci: kill BKL Arnd Bergmann
2010-08-13 23:33   ` Jesse Barnes
2010-07-03 22:02 ` [PATCH 5/8] dasd: no need for BKL in ioctl Arnd Bergmann
2010-07-03 22:02 ` Arnd Bergmann [this message]
2010-07-03 22:02 ` [PATCH 7/8] soundcore_open: Reduce the area BKL coverage Arnd Bergmann
2010-07-05 16:09   ` Takashi Iwai
2010-07-03 22:02 ` [PATCH 8/8] BKL: introduce CONFIG_BKL Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1278194552-24943-7-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=fweisbec@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®