Skip to contentSkip to conversation

fix compare_const_fl.cocci warnings

PATCH New Julia Lawall 1 participant 1 message Nov 11, 2015 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix compare_const_fl.cocci warnings

Move constants to the right of binary operators.

Semantic patch information:
Depends on personal taste in some cases.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

---

This is what Coccinelle generates. But it would really be more normal in the form !(x&y).

 usbtmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/class/usbtmc.c +1 -1
@@ -494,7 +494,7 @@ static int usbtmc488_ioctl_simple(struct
 
 	dev = &data->intf->dev;
 
-	if (0 == (data->usb488_caps & USBTMC488_CAPABILITY_SIMPLE))
+	if ((data->usb488_caps & USBTMC488_CAPABILITY_SIMPLE) == 0)
 		return -EINVAL;
 
 	buffer = kmalloc(8, GFP_KERNEL);