diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-17 10:56:11 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-17 10:56:11 -0700 |
| commit | 716f37f0b1935f62d717d0ca930453e10ddb4f08 (patch) | |
| tree | 4a8cf7152623f985bad35ed9f700167602f9e520 /usb/usb-bkl-remove-bkl-use-in-uhci-debug.patch | |
| parent | 257f39f2ae41a2830e6aac990ffcf9d419875ff5 (diff) | |
| download | patches-716f37f0b1935f62d717d0ca930453e10ddb4f08.tar.gz | |
usb patches and 2 serial ones
Diffstat (limited to 'usb/usb-bkl-remove-bkl-use-in-uhci-debug.patch')
| -rw-r--r-- | usb/usb-bkl-remove-bkl-use-in-uhci-debug.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/usb/usb-bkl-remove-bkl-use-in-uhci-debug.patch b/usb/usb-bkl-remove-bkl-use-in-uhci-debug.patch new file mode 100644 index 00000000000000..2df486dcdec147 --- /dev/null +++ b/usb/usb-bkl-remove-bkl-use-in-uhci-debug.patch @@ -0,0 +1,87 @@ +From arnd@arndb.de Thu Jun 17 10:42:10 2010 +From: Andi Kleen <ak@linux.intel.com> +Date: Tue, 1 Jun 2010 23:04:43 +0200 +Subject: USB-BKL: Remove BKL use in uhci-debug +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>, Andi Kleen <ak@linux.intel.com> +Message-ID: <1275426285-9088-5-git-send-email-arnd@arndb.de> + + +From: Andi Kleen <ak@linux.intel.com> + +BKL was not really needed, just came from earlier push downs. + +The only part that's a bit dodgy is the lseek function. Would +need another lock or atomic access to fpos on 32bit? +Better to have a libfs lseek + +Signed-off-by: Andi Kleen <ak@linux.intel.com> +Cc: Arnd Bergmann <arnd@arndb.de> +Cc: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/uhci-debug.c | 20 +++++++------------- + 1 file changed, 7 insertions(+), 13 deletions(-) + +--- a/drivers/usb/host/uhci-debug.c ++++ b/drivers/usb/host/uhci-debug.c +@@ -495,18 +495,16 @@ static int uhci_debug_open(struct inode + { + struct uhci_hcd *uhci = inode->i_private; + struct uhci_debug *up; +- int ret = -ENOMEM; + unsigned long flags; + +- lock_kernel(); + up = kmalloc(sizeof(*up), GFP_KERNEL); + if (!up) +- goto out; ++ return -ENOMEM; + + up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL); + if (!up->data) { + kfree(up); +- goto out; ++ return -ENOMEM; + } + + up->size = 0; +@@ -517,10 +515,7 @@ static int uhci_debug_open(struct inode + + file->private_data = up; + +- ret = 0; +-out: +- unlock_kernel(); +- return ret; ++ return 0; + } + + static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence) +@@ -528,9 +523,9 @@ static loff_t uhci_debug_lseek(struct fi + struct uhci_debug *up; + loff_t new = -1; + +- lock_kernel(); + up = file->private_data; + ++ /* XXX: atomic 64bit seek access, but that needs to be fixed in the VFS */ + switch (whence) { + case 0: + new = off; +@@ -539,11 +534,10 @@ static loff_t uhci_debug_lseek(struct fi + new = file->f_pos + off; + break; + } +- if (new < 0 || new > up->size) { +- unlock_kernel(); ++ ++ if (new < 0 || new > up->size) + return -EINVAL; +- } +- unlock_kernel(); ++ + return (file->f_pos = new); + } + |
