[amir73il:fsnotify-volatile 5/5] include/linux/compiler_types.h:346:45: error: call to '__compiletime_assert_271' declared with attribute error: BUILD_BUG_ON failed: HWEIGHT32(FANOTIFY_INIT_FLAGS) != 13

From: kernel test robot
Date: Wed Mar 02 2022 - 22:12:50 EST


tree: https://github.com/amir73il/linux fsnotify-volatile
head: bc58808cbec71bead5572997dafe604c50f2b4af
commit: bc58808cbec71bead5572997dafe604c50f2b4af [5/5] fanotify: FAN_MARK_VOLATILE - WIP
config: m68k-sun3x_defconfig (https://download.01.org/0day-ci/archive/20220303/202203030951.3eFFn4A5-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 11.2.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/amir73il/linux/commit/bc58808cbec71bead5572997dafe604c50f2b4af
git remote add amir73il https://github.com/amir73il/linux
git fetch --no-tags amir73il fsnotify-volatile
git checkout bc58808cbec71bead5572997dafe604c50f2b4af
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from <command-line>:
fs/notify/fanotify/fanotify_user.c: In function 'fanotify_user_setup':
>> include/linux/compiler_types.h:346:45: error: call to '__compiletime_assert_271' declared with attribute error: BUILD_BUG_ON failed: HWEIGHT32(FANOTIFY_INIT_FLAGS) != 13
346 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:327:25: note: in definition of macro '__compiletime_assert'
327 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler_types.h:346:9: note: in expansion of macro '_compiletime_assert'
346 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:1756:9: note: in expansion of macro 'BUILD_BUG_ON'
1756 | BUILD_BUG_ON(HWEIGHT32(FANOTIFY_INIT_FLAGS) != 13);
| ^~~~~~~~~~~~


vim +/__compiletime_assert_271 +346 include/linux/compiler_types.h

eb5c2d4b45e3d2d Will Deacon 2020-07-21 332
eb5c2d4b45e3d2d Will Deacon 2020-07-21 333 #define _compiletime_assert(condition, msg, prefix, suffix) \
eb5c2d4b45e3d2d Will Deacon 2020-07-21 334 __compiletime_assert(condition, msg, prefix, suffix)
eb5c2d4b45e3d2d Will Deacon 2020-07-21 335
eb5c2d4b45e3d2d Will Deacon 2020-07-21 336 /**
eb5c2d4b45e3d2d Will Deacon 2020-07-21 337 * compiletime_assert - break build and emit msg if condition is false
eb5c2d4b45e3d2d Will Deacon 2020-07-21 338 * @condition: a compile-time constant condition to check
eb5c2d4b45e3d2d Will Deacon 2020-07-21 339 * @msg: a message to emit if condition is false
eb5c2d4b45e3d2d Will Deacon 2020-07-21 340 *
eb5c2d4b45e3d2d Will Deacon 2020-07-21 341 * In tradition of POSIX assert, this macro will break the build if the
eb5c2d4b45e3d2d Will Deacon 2020-07-21 342 * supplied condition is *false*, emitting the supplied error message if the
eb5c2d4b45e3d2d Will Deacon 2020-07-21 343 * compiler has support to do so.
eb5c2d4b45e3d2d Will Deacon 2020-07-21 344 */
eb5c2d4b45e3d2d Will Deacon 2020-07-21 345 #define compiletime_assert(condition, msg) \
eb5c2d4b45e3d2d Will Deacon 2020-07-21 @346 _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
eb5c2d4b45e3d2d Will Deacon 2020-07-21 347

:::::: The code at line 346 was first introduced by commit
:::::: eb5c2d4b45e3d2d5d052ea6b8f1463976b1020d5 compiler.h: Move compiletime_assert() macros into compiler_types.h

:::::: TO: Will Deacon <will@xxxxxxxxxx>
:::::: CC: Will Deacon <will@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx