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

kernel test robot
2022-06-05T21:54:07Z

config: arm-at91_dt_defconfig (https://download.01.org/0day-ci/archive/20220606/202206060529.iKPUpMUp-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/0fad3ce70c6f6736d3913e3238642a056f70b123
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/kernel-h-Move-sysfs-related-macro-to-sysfs-h/20220606-004344
git checkout 0fad3ce70c6f6736d3913e3238642a056f70b123
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

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: some warnings being treated as errors

vim +/VERIFY_OCTAL_PERMISSIONS +294 include/linux/moduleparam.h

91d35dd93e14c3 Ivan Kokshaysky 2008-02-13 284
^1da177e4c3f41 Linus Torvalds 2005-04-16 285 /* This is the fundamental function for registering boot/module
546970bc6afc7f Rusty Russell 2010-08-11 286 parameters. */
91f9d330cc1493 Jani Nikula 2014-08-27 287 #define __module_param_call(prefix, name, ops, arg, perm, level, flags) \
9774a1f54f173a Alexey Dobriyan 2006-12-06 288 /* Default value instead of permissions? */ \
22e48eaf587d04 Jan Beulich 2007-10-16 289 static const char __param_str_##name[] = prefix #name; \
91d35dd93e14c3 Ivan Kokshaysky 2008-02-13 290 static struct kernel_param __moduleparam_const __param_##name \
fe2f4fe139b321 Johan Hovold 2020-11-23 291 __used __section("__param") \
fe2f4fe139b321 Johan Hovold 2020-11-23 292 __aligned(__alignof__(struct kernel_param)) \
b51d23e4e9fea6 Dan Streetman 2015-06-17 293 = { __param_str_##name, THIS_MODULE, ops, \
b51d23e4e9fea6 Dan Streetman 2015-06-17 @294 VERIFY_OCTAL_PERMISSIONS(perm), level, flags, { arg } }
^1da177e4c3f41 Linus Torvalds 2005-04-16 295