Re: [PATCH v2 2/2] linux/bits.h: Add compile time sanity check of GENMASK inputs

From: kbuild test robot
Date: Wed Aug 07 2019 - 22:46:58 EST


Hi Rikard,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc3 next-20190807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Rikard-Falkeborn/linux-bits-h-Clarify-macro-argument-names/20190805-024030
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-10) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

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

All warnings (new ones prefixed by >>):

In file included from include/linux/bits.h:22:0,
from arch/x86/include/asm/msr-index.h:5,
from arch/x86/boot/cpucheck.c:28:
>> include/linux/build_bug.h:49:0: warning: "BUILD_BUG_ON" redefined
#define BUILD_BUG_ON(condition) \

In file included from arch/x86/boot/cpucheck.c:22:0:
arch/x86/boot/boot.h:31:0: note: this is the location of the previous definition
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))


vim +/BUILD_BUG_ON +49 include/linux/build_bug.h

bc6245e5efd70c Ian Abbott 2017-07-10 40
bc6245e5efd70c Ian Abbott 2017-07-10 41 /**
bc6245e5efd70c Ian Abbott 2017-07-10 42 * BUILD_BUG_ON - break compile if a condition is true.
bc6245e5efd70c Ian Abbott 2017-07-10 43 * @condition: the condition which the compiler should know is false.
bc6245e5efd70c Ian Abbott 2017-07-10 44 *
bc6245e5efd70c Ian Abbott 2017-07-10 45 * If you have some code which relies on certain constants being equal, or
bc6245e5efd70c Ian Abbott 2017-07-10 46 * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to
bc6245e5efd70c Ian Abbott 2017-07-10 47 * detect if someone changes it.
bc6245e5efd70c Ian Abbott 2017-07-10 48 */
bc6245e5efd70c Ian Abbott 2017-07-10 @49 #define BUILD_BUG_ON(condition) \
bc6245e5efd70c Ian Abbott 2017-07-10 50 BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
bc6245e5efd70c Ian Abbott 2017-07-10 51

:::::: The code at line 49 was first introduced by commit
:::::: bc6245e5efd70c41eaf9334b1b5e646745cb0fb3 bug: split BUILD_BUG stuff out into <linux/build_bug.h>

:::::: TO: Ian Abbott <abbotti@xxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip