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@huawei.com>
Link: https://lore.kernel.org/r/20220511064622.3399164-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yang Yingliang 2022-05-11 14:46:22 +08:00 committed by Greg Kroah-Hartman
parent c337125b88
commit 5621a0bcb4
1 changed files with 1 additions and 2 deletions

View File

@ -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);
}