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 c988d2b284549 "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>
This commit is contained in:
parent
bf262dcec6
commit
c75b590d60
@ -1693,8 +1693,7 @@ static int module_add_modinfo_attrs(struct module *mod)
|
|||||||
|
|
||||||
temp_attr = mod->modinfo_attrs;
|
temp_attr = mod->modinfo_attrs;
|
||||||
for (i = 0; (attr = modinfo_attrs[i]) && !error; i++) {
|
for (i = 0; (attr = modinfo_attrs[i]) && !error; i++) {
|
||||||
if (!attr->test ||
|
if (!attr->test || attr->test(mod)) {
|
||||||
(attr->test && attr->test(mod))) {
|
|
||||||
memcpy(temp_attr, attr, sizeof(*temp_attr));
|
memcpy(temp_attr, attr, sizeof(*temp_attr));
|
||||||
sysfs_attr_init(&temp_attr->attr);
|
sysfs_attr_init(&temp_attr->attr);
|
||||||
error = sysfs_create_file(&mod->mkobj.kobj,
|
error = sysfs_create_file(&mod->mkobj.kobj,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user