[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1650505393-19398-1-git-send-email-baihaowen@meizu.com>
Date: Thu, 21 Apr 2022 09:43:13 +0800
From: Haowen Bai <baihaowen@...zu.com>
To: <gregkh@...uxfoundation.org>
CC: <ardb@...nel.org>, <baihaowen@...zu.com>,
<bjorn.andersson@...aro.org>, <cristian.marussi@....com>,
<linux-kernel@...r.kernel.org>, <sudeep.holla@....com>
Subject: [PATCH V2] firmware: edd: Remove redundant condition
The logic (!A || (A && B)) is equivalent to (!A || B). so we have
to make code clear.
Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
V1->V2:
change changelog text
1. !A || A && B -> (!A || (A && B))
2. !A || B -> (!A || B)
drivers/firmware/edd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 69353dd0ea22..5cc238916551 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -685,8 +685,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);
}
--
2.7.4
Powered by blists - more mailing lists