From 9052127f631c8d71d5149da08d48014283faff2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9meth=20M=C3=A1rton?= Date: Sun, 10 Jan 2010 15:34:36 +0100 Subject: USB image: make USB device id constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The id_table field of the struct usb_device_id is constant in so it is worth to make the initialization data also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // Signed-off-by: Németh Márton Cc: Julia Lawall Cc: cocci@diku.dk Signed-off-by: Greg Kroah-Hartman --- drivers/usb/image/mdc800.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/image/mdc800.c') diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index eca355dccf65..e192e8f7c560 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -967,7 +967,7 @@ static const struct file_operations mdc800_device_ops = -static struct usb_device_id mdc800_table [] = { +static const struct usb_device_id mdc800_table[] = { { USB_DEVICE(MDC800_VENDOR_ID, MDC800_PRODUCT_ID) }, { } /* Terminating entry */ }; -- cgit v1.2.3 From 86266452f80545285c14e20a8024f79c4fb88a86 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Wed, 13 Jan 2010 15:33:15 +0100 Subject: USB: Push BKL on open down into the drivers Straightforward push into the drivers to allow auditing individual drivers separately Signed-off-by: Oliver Neukum Acked-by: Mauro Carvalho Chehab Cc: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/usb/image/mdc800.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/usb/image/mdc800.c') diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index e192e8f7c560..dce4f7b69ac3 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -96,6 +96,7 @@ #include #include #include +#include #include #include @@ -622,6 +623,7 @@ static int mdc800_device_open (struct inode* inode, struct file *file) int retval=0; int errn=0; + lock_kernel(); mutex_lock(&mdc800->io_lock); if (mdc800->state == NOT_CONNECTED) @@ -660,6 +662,7 @@ static int mdc800_device_open (struct inode* inode, struct file *file) error_out: mutex_unlock(&mdc800->io_lock); + unlock_kernel(); return errn; } -- cgit v1.2.3 From 5a207b431174ecc8f995230d19c79242160b8888 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Thu, 14 Jan 2010 16:10:05 +0100 Subject: USB: BKL removal: mdc800 BKL not needed at all. Removed without replacement. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/image/mdc800.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/usb/image/mdc800.c') diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index dce4f7b69ac3..e192e8f7c560 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -96,7 +96,6 @@ #include #include #include -#include #include #include @@ -623,7 +622,6 @@ static int mdc800_device_open (struct inode* inode, struct file *file) int retval=0; int errn=0; - lock_kernel(); mutex_lock(&mdc800->io_lock); if (mdc800->state == NOT_CONNECTED) @@ -662,7 +660,6 @@ static int mdc800_device_open (struct inode* inode, struct file *file) error_out: mutex_unlock(&mdc800->io_lock); - unlock_kernel(); return errn; } -- cgit v1.2.3