lkml.org 
[lkml]   [2003]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subjectreplaced BKL in rio500.c [2.5.69]
Date
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.");

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [from the cache]
©2003-2011 Jasper Spaans