Skip to content

Commit c75b590

Browse files
committed
module: fix redundant test.
[linux-4.5-rc4/kernel/module.c:1692]: (style) Redundant condition: attr.test. '!attr.test || (attr.test && attr.test(mod))' is equivalent to '!attr.test || attr.test(mod)' This code was added like this ten years ago, in c988d2b "modules: add version and srcversion to sysfs". Reported-by: David Binderman <dcb314@hotmail.com> Cc: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent bf262dc commit c75b590

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎kernel/module.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,8 +1693,7 @@ static int module_add_modinfo_attrs(struct module *mod)
16931693

16941694
temp_attr = mod->modinfo_attrs;
16951695
for (i = 0; (attr = modinfo_attrs[i]) && !error; i++) {
1696-
if (!attr->test ||
1697-
(attr->test && attr->test(mod))) {
1696+
if (!attr->test || attr->test(mod)) {
16981697
memcpy(temp_attr, attr, sizeof(*temp_attr));
16991698
sysfs_attr_init(&temp_attr->attr);
17001699
error = sysfs_create_file(&mod->mkobj.kobj,

0 commit comments

Comments
 (0)