Re: [PATCH v1 1/1] kernel.h: Move sysfs related macro to sysfs.h

Andrew Morton
2022-06-03T19:16:21Z

On Fri, 3 Jun 2022 20:21:01 +0300 Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> As stated in the comment of VERIFY_OCTAL_PERMISSIONS() it's related to sysfs.
> Move it to the corresponding header.

arm allmodconfig:

In file included from arch/arm/mm/alignment.c:11:
./include/linux/moduleparam.h:294:13: error: implicit declaration of function 'VERIFY_OCTAL_PERMISSIONS' [-Werror=implicit-function-declaration]
294 | VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }
| ^~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/moduleparam.h:330:9: note: in expansion of macro '__module_param_call'
330 | __module_param_call("", name, &param_ops_##type, &var, perm, -1, 0)
| ^~~~~~~~~~~~~~~~~~~
arch/arm/mm/alignment.c:87:1: note: in expansion of macro 'core_param'
87 | core_param(alignment, ai_usermode, int, 0600);
| ^~~~~~~~~~
./include/linux/moduleparam.h:294:13: error: initializer element is not constant
294 | VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }
| ^~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/moduleparam.h:330:9: note: in expansion of macro '__module_param_call'
330 | __module_param_call("", name, &param_ops_##type, &var, perm, -1, 0)
| ^~~~~~~~~~~~~~~~~~~
arch/arm/mm/alignment.c:87:1: note: in expansion of macro 'core_param'
87 | core_param(alignment, ai_usermode, int, 0600);
| ^~~~~~~~~~
./include/linux/moduleparam.h:294:13: note: (near initialization for '__param_alignment.perm')
294 | VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }
| ^~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/moduleparam.h:330:9: note: in expansion of macro '__module_param_call'
330 | __module_param_call("", name, &param_ops_##type, &var, perm, -1, 0)
| ^~~~~~~~~~~~~~~~~~~
arch/arm/mm/alignment.c:87:1: note: in expansion of macro 'core_param'
87 | core_param(alignment, ai_usermode, int, 0600);
| ^~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: arch/arm/mm/alignment.o] Error 1
make[1]: *** [scripts/Makefile.build:500: arch/arm/mm] Error 2
make: *** [Makefile:1839: arch/arm] Error 2