Skip to contentSkip to conversation

firmware: edd: fix Coccinelle warnings

PATCH New CGEL 1 participant 1 message Aug 20, 2021

lore
Share & tools
lore

CGEL

author
#0 lore raw

PATCH 1/1 firmware: edd: fix Coccinelle warnings

From: jing yangyang <[email protected]>

WARNING !A || A && B is equivalent to !A || B

This issue was detected with the help of Coccinelle.

---
 drivers/firmware/edd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/edd.c +1 -2
index 14d0970..e8b409e 100644
@@ -694,8 +694,7 @@ static void edd_populate_dir(struct edd_device * edev)
 	int i;
 
 	for (i = 0; (attr = edd_attrs[i]) && !error; i++) {
-		if (!attr->test ||
-		    (attr->test && attr->test(edev)))
+		if (!attr->test || attr->test(edev))
 			error = sysfs_create_file(&edev->kobj,&attr->attr);
 	}
 
Signature · 1 line
1.8.3.1