diff options
author | Andi Kleen <ak@linux.intel.com> | 2010-06-01 17:04:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 17:35:36 -0400 |
commit | 00b81fb23a4937a24cb010f41ac173a786eb4c55 (patch) | |
tree | c6f15d0b85f3bc57be138877c56522aafbe9c768 /drivers/usb/host/uhci-debug.c | |
parent | 0daeed381c6a33fdbdc3b0e9f09d96f0a2a8a195 (diff) |
USB-BKL: Remove BKL use in uhci-debug
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>
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 98cf0b26b968..c168999722d1 100644 --- 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 *inode, struct file *file) | |||
495 | { | 495 | { |
496 | struct uhci_hcd *uhci = inode->i_private; | 496 | struct uhci_hcd *uhci = inode->i_private; |
497 | struct uhci_debug *up; | 497 | struct uhci_debug *up; |
498 | int ret = -ENOMEM; | ||
499 | unsigned long flags; | 498 | unsigned long flags; |
500 | 499 | ||
501 | lock_kernel(); | ||
502 | up = kmalloc(sizeof(*up), GFP_KERNEL); | 500 | up = kmalloc(sizeof(*up), GFP_KERNEL); |
503 | if (!up) | 501 | if (!up) |
504 | goto out; | 502 | return -ENOMEM; |
505 | 503 | ||
506 | up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL); | 504 | up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL); |
507 | if (!up->data) { | 505 | if (!up->data) { |
508 | kfree(up); | 506 | kfree(up); |
509 | goto out; | 507 | return -ENOMEM; |
510 | } | 508 | } |
511 | 509 | ||
512 | up->size = 0; | 510 | up->size = 0; |
@@ -517,10 +515,7 @@ static int uhci_debug_open(struct inode *inode, struct file *file) | |||
517 | 515 | ||
518 | file->private_data = up; | 516 | file->private_data = up; |
519 | 517 | ||
520 | ret = 0; | 518 | return 0; |
521 | out: | ||
522 | unlock_kernel(); | ||
523 | return ret; | ||
524 | } | 519 | } |
525 | 520 | ||
526 | static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence) | 521 | 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 file *file, loff_t off, int whence) | |||
528 | struct uhci_debug *up; | 523 | struct uhci_debug *up; |
529 | loff_t new = -1; | 524 | loff_t new = -1; |
530 | 525 | ||
531 | lock_kernel(); | ||
532 | up = file->private_data; | 526 | up = file->private_data; |
533 | 527 | ||
528 | /* XXX: atomic 64bit seek access, but that needs to be fixed in the VFS */ | ||
534 | switch (whence) { | 529 | switch (whence) { |
535 | case 0: | 530 | case 0: |
536 | new = off; | 531 | new = off; |
@@ -539,11 +534,10 @@ static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence) | |||
539 | new = file->f_pos + off; | 534 | new = file->f_pos + off; |
540 | break; | 535 | break; |
541 | } | 536 | } |
542 | if (new < 0 || new > up->size) { | 537 | |
543 | unlock_kernel(); | 538 | if (new < 0 || new > up->size) |
544 | return -EINVAL; | 539 | return -EINVAL; |
545 | } | 540 | |
546 | unlock_kernel(); | ||
547 | return (file->f_pos = new); | 541 | return (file->f_pos = new); |
548 | } | 542 | } |
549 | 543 | ||