Staging: comedi: Correct use of ! and &

Author: Julia Lawall <julia@diku.dk>

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 


---
 drivers/staging/comedi/drivers/me4000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c
index b432aa7..cc29315 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);
BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.