[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220511064622.3399164-1-yangyingliang@huawei.com>
Date: Wed, 11 May 2022 14:46:22 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <linux-kernel@...r.kernel.org>
CC: <gregkh@...uxfoundation.org>
Subject: [PATCH -next] edd: simplify the check of 'attr->test' in edd_populate_dir()
attr->test check is not needed when !attr->test is false.
Signed-off-by: Yang Yingliang <yangyingliang@...wei.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 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.25.1
Powered by blists - more mailing lists