tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: af37ad1e01c72483c4ee8453d9d9bac95d35f023 commit: 4b5ee4844d32548ffda8d85c8e4ec86fc791861b [7767/8605] minmax: sanity check constant bounds when clamping config: arc-allyesconfig compiler: arceb-elf-gcc (GCC) 12.1.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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=4b5ee4844d32548ffda8d85c8e4ec86fc791861b git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 4b5ee4844d32548ffda8d85c8e4ec86fc791861b # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot Note: the linux-next/master HEAD af37ad1e01c72483c4ee8453d9d9bac95d35f023 builds fine. It may have been fixed somewhere. All errors (new ones prefixed by >>): In file included from include/linux/container_of.h:5, from include/linux/kernel.h:21, from drivers/net/wireless/ralink/rt2x00/rt2800lib.c:25: drivers/net/wireless/ralink/rt2x00/rt2800lib.c: In function 'rt2800_txpower_to_dev': >> include/linux/build_bug.h:16:51: error: negative width in bit-field '' 16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); }))) | ^ include/linux/minmax.h:50:10: note: in expansion of macro 'BUILD_BUG_ON_ZERO' 50 | (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \ | ^~~~~~~~~~~~~~~~~ include/linux/minmax.h:54:9: note: in expansion of macro '__clamp_input_check' 54 | __clamp_input_check(lo, hi) + \ | ^~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:146:36: note: in expansion of macro '__careful_clamp' 146 | #define clamp_t(type, val, lo, hi) __careful_clamp((type)(val), (type)(lo), (type)(hi)) | ^~~~~~~~~~~~~~~ drivers/net/wireless/ralink/rt2x00/rt2800lib.c:4054:24: note: in expansion of macro 'clamp_t' 4054 | return clamp_t(char, txpower, MIN_A_TXPOWER, MAX_A_TXPOWER); | ^~~~~~~ vim +16 include/linux/build_bug.h bc6245e5efd70c4 Ian Abbott 2017-07-10 6 bc6245e5efd70c4 Ian Abbott 2017-07-10 7 #ifdef __CHECKER__ bc6245e5efd70c4 Ian Abbott 2017-07-10 8 #define BUILD_BUG_ON_ZERO(e) (0) bc6245e5efd70c4 Ian Abbott 2017-07-10 9 #else /* __CHECKER__ */ bc6245e5efd70c4 Ian Abbott 2017-07-10 10 /* bc6245e5efd70c4 Ian Abbott 2017-07-10 11 * Force a compilation error if condition is true, but also produce a 8788994376d84d6 Rikard Falkeborn 2019-12-04 12 * result (of value 0 and type int), so the expression can be used bc6245e5efd70c4 Ian Abbott 2017-07-10 13 * e.g. in a structure initializer (or where-ever else comma expressions bc6245e5efd70c4 Ian Abbott 2017-07-10 14 * aren't permitted). bc6245e5efd70c4 Ian Abbott 2017-07-10 15 */ 8788994376d84d6 Rikard Falkeborn 2019-12-04 @16 #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); }))) 527edbc18a70e74 Masahiro Yamada 2019-01-03 17 #endif /* __CHECKER__ */ 527edbc18a70e74 Masahiro Yamada 2019-01-03 18 :::::: The code at line 16 was first introduced by commit :::::: 8788994376d84d627450fd0d67deb6a66ddf07d7 linux/build_bug.h: change type to int :::::: TO: Rikard Falkeborn :::::: CC: Linus Torvalds -- 0-DAY CI Kernel Test Service https://01.org/lkp