On 5/24/2022 4:33 AM, viktor.barna@xxxxxxxxxx wrote: [snip]
+#define READ_BOOL(param) \ +{ \ + if (!strcmp(name, #param)) { \ + bool new_val = false; \ + ret = kstrtobool(value, &new_val); \ + if (ret) { \ + pr_err("%s: invalid value [%s]\n", #param, value); \ + break; \ + } \ + if (conf->param != new_val) { \ + pr_debug("%s: old value %u -> new value %u\n", \ + #param, conf->param, new_val); \ + conf->param = new_val; \ + } \ + break; \ + } \ +}
You should review the guidance on macros at <https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl> Note that things to avoid include: 1. macros that affect control flow 2. macros that depend on having a local variable with a magic name