From: Julia Lawall Date: Wed, 24 Dec 2008 15:23:10 +0000 (+0100) Subject: Staging: comedi: Correct use of ! and & X-Git-Tag: v2.6.30-rc1~202^2~438 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d86d3a0101d958988a715abb7ea4687690f0b52f;p=karo-tx-linux.git Staging: comedi: Correct use of ! and & 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/) // @@ expression E; constant C; @@ ( !E & !C | - !E & C + !(E & C) ) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c index b432aa7d7644..cc29315ecad4 100644 --- a/drivers/staging/comedi/drivers/me4000.c +++ b/drivers/staging/comedi/drivers/me4000.c @@ -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);