Skip to contentSkip to conversation

edd: Simplify the calculation of variables

PATCH New Jiapeng Zhong 1 participant 1 message Jan 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 edd: Simplify the calculation of variables

Fix the following coccicheck warnings:

./drivers/firmware/edd.c:698:18-20: WARNING !A || A && B is equivalent to !A || B.

---
 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