Staging: go7007: Eliminate useless code
authorJulia Lawall <julia@diku.dk>
Sat, 16 Jan 2010 15:59:22 +0000 (16:59 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:45 +0000 (16:42 -0800)
The variable s is initialized twice to the same (side effect-free)
expression.  Drop one initialization.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@forall@
idexpression *x;
identifier f!=ERR_PTR;
@@

x = f(...)
... when != x
(
x = f(...,<+...x...+>,...)
|
* x = f(...)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/go7007/s2250-loader.c

index ef833e0d63ae83939d3f6b0e070dcda54aae77ba..1de2dfb16d3f7c1b30c0633b9cd403d282b0cdd0 100644 (file)
@@ -139,7 +139,7 @@ failed2:
 
 static void s2250loader_disconnect(struct usb_interface *interface)
 {
-       pdevice_extension_t s = usb_get_intfdata(interface);
+       pdevice_extension_t s;
        printk(KERN_INFO "s2250: disconnect\n");
        lock_kernel();
        s = usb_get_intfdata(interface);