Staging: comedi: Correct use of ! and &
authorJulia Lawall <julia@diku.dk>
Wed, 24 Dec 2008 15:23:10 +0000 (16:23 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:40 +0000 (14:53 -0700)
0x20 has 0 as its rightmost bit and thus !inl(info->plx_regbase +
PLX_INTCSR) & 0x20 is always 0.  I assume that !(!inl(info->plx_regbase +
PLX_INTCSR) & 0x20) was intended.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E; constant C; @@
(
  !E & !C
|
- !E & C
+ !(E & C)
)
// </smpl>

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

index b432aa7..cc29315 100644 (file)
@@ -782,7 +782,7 @@ static int xilinx_download(comedi_device * dev)
 
        /* Wait until /INIT pin is set */
        udelay(20);
-       if (!inl(info->plx_regbase + PLX_INTCSR) & 0x20) {
+       if (!(inl(info->plx_regbase + PLX_INTCSR) & 0x20)) {
                printk(KERN_ERR
                        "comedi%d: me4000: xilinx_download(): Can't init Xilinx\n",
                        dev->minor);