diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-05-11 08:46:22 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-19 18:57:04 +0200 |
commit | 5621a0bcb4b4dffc87d74330a9a31b868572f763 (patch) | |
tree | e2b3d24165d39a45f871c5a0167e055b342299ce /drivers/firmware/edd.c | |
parent | bus: ti-sysc: Fix warnings for unbind for serial (diff) | |
download | linux-5621a0bcb4b4dffc87d74330a9a31b868572f763.tar.xz linux-5621a0bcb4b4dffc87d74330a9a31b868572f763.zip |
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>
Diffstat (limited to 'drivers/firmware/edd.c')
-rw-r--r-- | drivers/firmware/edd.c | 3 |
1 files changed, 1 insertions, 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); } |