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:
parent
c337125b88
commit
5621a0bcb4
|
@ -685,8 +685,7 @@ static void edd_populate_dir(struct edd_device * edev)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; (attr = edd_attrs[i]) && !error; i++) {
|
for (i = 0; (attr = edd_attrs[i]) && !error; i++) {
|
||||||
if (!attr->test ||
|
if (!attr->test || attr->test(edev))
|
||||||
(attr->test && attr->test(edev)))
|
|
||||||
error = sysfs_create_file(&edev->kobj,&attr->attr);
|
error = sysfs_create_file(&edev->kobj,&attr->attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue