== Series Details ==

Series: add support for enum module parameters
URL   : https://patchwork.freedesktop.org/series/102695/
State : warning

== Summary ==

Error: dim checkpatch failed
8c6849f919aa module: add enum module parameter type to map names to values
-:73: ERROR:OPEN_BRACE: open brace '{' following struct go on the same line
#73: FILE: include/linux/moduleparam.h:109:
+struct kparam_enum
+{

-:88: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files
#88: FILE: include/linux/moduleparam.h:503:
+extern int param_set_enum(const char *key, const struct kernel_param *kp);

-:89: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files
#89: FILE: include/linux/moduleparam.h:504:
+extern int param_get_enum(char *buffer, const struct kernel_param *kp);

-:116: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'name' - possible 
side-effects?
#116: FILE: include/linux/moduleparam.h:563:
+#define module_param_enum(name, enumerations, perm)                    \
+       module_param_enum_named(name, name, enumerations, perm)

-:129: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'name' - possible 
side-effects?
#129: FILE: include/linux/moduleparam.h:576:
+#define module_param_enum_named(name, value, enumerations, perm)       \
+       param_check_int(name, &(value));                                \
+       static const struct kparam_enum __param_arr_##name =            \
+       {                                                               \
+               .enums = enumerations,                                  \
+               .num_enums = ARRAY_SIZE(enumerations),                  \
+               .val = &value                                           \
+       };                                                              \
+       __module_param_call(MODULE_PARAM_PREFIX, name,                  \
+                           &param_ops_enum,                            \
+                           .enumeration = &__param_arr_##name,         \
+                           perm, -1, 0);                               \
+       __MODULE_PARM_TYPE(name, "enumeration")

-:129: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'value' - possible 
side-effects?
#129: FILE: include/linux/moduleparam.h:576:
+#define module_param_enum_named(name, value, enumerations, perm)       \
+       param_check_int(name, &(value));                                \
+       static const struct kparam_enum __param_arr_##name =            \
+       {                                                               \
+               .enums = enumerations,                                  \
+               .num_enums = ARRAY_SIZE(enumerations),                  \
+               .val = &value                                           \
+       };                                                              \
+       __module_param_call(MODULE_PARAM_PREFIX, name,                  \
+                           &param_ops_enum,                            \
+                           .enumeration = &__param_arr_##name,         \
+                           perm, -1, 0);                               \
+       __MODULE_PARM_TYPE(name, "enumeration")

-:129: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'enumerations' - possible 
side-effects?
#129: FILE: include/linux/moduleparam.h:576:
+#define module_param_enum_named(name, value, enumerations, perm)       \
+       param_check_int(name, &(value));                                \
+       static const struct kparam_enum __param_arr_##name =            \
+       {                                                               \
+               .enums = enumerations,                                  \
+               .num_enums = ARRAY_SIZE(enumerations),                  \
+               .val = &value                                           \
+       };                                                              \
+       __module_param_call(MODULE_PARAM_PREFIX, name,                  \
+                           &param_ops_enum,                            \
+                           .enumeration = &__param_arr_##name,         \
+                           perm, -1, 0);                               \
+       __MODULE_PARM_TYPE(name, "enumeration")

-:161: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around e->val
#161: FILE: kernel/params.c:544:
+                       *(e->val) = e->enums[i].val;

-:178: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around e->val
#178: FILE: kernel/params.c:561:
+               if (*(e->val) == e->enums[i].val)

-:178: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'e->val'
#178: FILE: kernel/params.c:561:
+               if (*(e->val) == e->enums[i].val)

-:183: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around e->val
#183: FILE: kernel/params.c:566:
+              kp->name, *(e->val));

total: 1 errors, 0 warnings, 10 checks, 135 lines checked


Reply via email to