[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1634714570-58098-1-git-send-email-wangqing@vivo.com>
Date: Wed, 20 Oct 2021 00:22:50 -0700
From: Qing Wang <wangqing@...o.com>
To: linux-kernel@...r.kernel.org, tiwai@...u.de,
gregkh@...uxfoundation.org
Cc: Wang Qing <wangqing@...o.com>
Subject: [PATCH] firmware: edd: simplify redundant logic judgment
From: Wang Qing <wangqing@...o.com>
A || (!A && B) is equal to A || B
Signed-off-by: Wang Qing <wangqing@...o.com>
---
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 14d0970..e8b409e
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -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);
}
--
2.7.4
Powered by blists - more mailing lists