linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* replaced BKL in rio500.c [2.5.69]
@ 2003-05-25 15:01 Daniele Bellucci
  0 siblings, 0 replies; only message in thread
From: Daniele Bellucci @ 2003-05-25 15:01 UTC (permalink / raw)
  To: linux-kernel

In open_rio a BKL is acquired, there is no need because rio500 never sleeps in such control path.
Also, if you look at ioctl_rio a semaphore is acquired/released for the same check.



--- linux-2.5.69/drivers/usb/miscrio500.c       2003-05-26 16:23:20.000000000 +0200
+++ linux-2.5.69-new/drivers/usb/misc/rio500.c  2003-05-26 16:24:36.000000000 +0200
@@ -23,6 +23,9 @@
  *
  * Based upon mouse.c (Brad Keryan) and printer.c (Michael Gee).
  *
+ * Changelog:
+ * 25/05/03  replaced lock/unlock_kernel with up/down in open_rio.
+ *           Daniele Bellucci (bellucda@tiscali.it) 
  * */
 
 #include <linux/module.h>
@@ -81,17 +84,17 @@
 {
        struct rio_usb_data *rio = &rio_instance;
 
-       lock_kernel();
+       down(&(rio->lock));
 
        if (rio->isopen || !rio->present) {
-               unlock_kernel();
+               up(&(rio->lock));
                return -EBUSY;
        }
        rio->isopen = 1;
 
        init_waitqueue_head(&rio->wait_q);
 
-       unlock_kernel();
+       up(&(rio->lock));
 
        info("Rio opened.");
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-25 14:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-25 15:01 replaced BKL in rio500.c [2.5.69] Daniele Bellucci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).