From: Arnd Bergmann <arnd@arndb.de>
To: Greg KH <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
linux-usb@vger.kernel.org,
Frederic Weisbecker <fweisbec@gmail.com>,
John Kacur <jkacur@redhat.com>, Andi Kleen <andi@firstfloor.org>
Subject: [PATCH 6/6] usb/mon: kill BKL usage
Date: Tue, 1 Jun 2010 23:04:45 +0200 [thread overview]
Message-ID: <1275426285-9088-7-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1275426285-9088-1-git-send-email-arnd@arndb.de>
compat_ioctl does not use the BKL, so I assume that
the native function does not need it either.
The open function is already protected by the
driver's mutex, the BKL is probably not needed
here either.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/usb/mon/mon_bin.c | 22 ++--------------------
1 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index 61c76b1..1be0b9f 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -646,17 +646,14 @@ static int mon_bin_open(struct inode *inode, struct file *file)
size_t size;
int rc;
- lock_kernel();
mutex_lock(&mon_lock);
if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) {
mutex_unlock(&mon_lock);
- unlock_kernel();
return -ENODEV;
}
if (mbus != &mon_bus0 && mbus->u_bus == NULL) {
printk(KERN_ERR TAG ": consistency error on open\n");
mutex_unlock(&mon_lock);
- unlock_kernel();
return -ENODEV;
}
@@ -689,7 +686,6 @@ static int mon_bin_open(struct inode *inode, struct file *file)
file->private_data = rp;
mutex_unlock(&mon_lock);
- unlock_kernel();
return 0;
err_allocbuff:
@@ -698,7 +694,6 @@ err_allocvec:
kfree(rp);
err_alloc:
mutex_unlock(&mon_lock);
- unlock_kernel();
return rc;
}
@@ -954,7 +949,7 @@ static int mon_bin_queued(struct mon_reader_bin *rp)
/*
*/
-static int mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct mon_reader_bin *rp = file->private_data;
// struct mon_bus* mbus = rp->r.m_bus;
@@ -1094,19 +1089,6 @@ static int mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return ret;
}
-static long mon_bin_unlocked_ioctl(struct file *file, unsigned int cmd,
- unsigned long arg)
-{
- int ret;
-
- lock_kernel();
- ret = mon_bin_ioctl(file, cmd, arg);
- unlock_kernel();
-
- return ret;
-}
-
-
#ifdef CONFIG_COMPAT
static long mon_bin_compat_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
@@ -1250,7 +1232,7 @@ static const struct file_operations mon_fops_binary = {
.read = mon_bin_read,
/* .write = mon_text_write, */
.poll = mon_bin_poll,
- .unlocked_ioctl = mon_bin_unlocked_ioctl,
+ .unlocked_ioctl = mon_bin_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = mon_bin_compat_ioctl,
#endif
--
1.7.0.4
next prev parent reply other threads:[~2010-06-01 21:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 21:04 [PATCH 0/6] USB: BKL removal Arnd Bergmann
2010-06-01 21:04 ` [PATCH 1/6] USB-BKL: Remove lock_kernel in usbfs update_sb() Arnd Bergmann
2010-06-01 21:04 ` [PATCH 2/6] USB-BKL: Convert usb_driver ioctl to unlocked_ioctl Arnd Bergmann
2010-06-01 21:04 ` [PATCH 3/6] USB-BKL: Remove BKL use for usb serial driver probing Arnd Bergmann
2010-06-01 21:04 ` [PATCH 4/6] USB-BKL: Remove BKL use in uhci-debug Arnd Bergmann
2010-06-02 10:11 ` Sergei Shtylyov
2010-06-17 17:44 ` Greg KH
2010-06-02 13:47 ` Alan Stern
2010-06-17 17:43 ` Greg KH
2010-06-01 21:04 ` [PATCH 5/6] usb/gadget: Do not take BKL for gadget->ops->ioctl Arnd Bergmann
2010-06-18 13:59 ` Michał Nazarewicz
2010-06-18 18:22 ` Arnd Bergmann
2010-06-29 14:08 ` David Brownell
2010-06-01 21:04 ` Arnd Bergmann [this message]
2010-06-17 17:46 ` [PATCH 0/6] USB: BKL removal Greg KH
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=1275426285-9088-7-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andi@firstfloor.org \
--cc=fweisbec@gmail.com \
--cc=gregkh@suse.de \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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
Powered by JetHome