[thomas-weissschuh:b4/cros_ec-hwmon-overflow 3/3] drivers/hwmon/cros_ec_hwmon.c:164:3: error: call to '__compiletime_assert_374' declared with 'error' attribute: BUILD_BUG_ON failed: sizeof(long) == 8

kernel test robot <[email protected]> Wed, 22 Jul 2026 02:31:54 +0800
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
:::::: 
:::::: Manual check reason: "__compiletime_assert_NNN"
:::::: 

BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: "Thomas Weißschuh" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/thomas.weissschuh/linux.git b4/cros_ec-hwmon-overflow
head:   28e1174f3fb10673f8b21957788df92430073be0
commit: 28e1174f3fb10673f8b21957788df92430073be0 [3/3] x
:::::: branch date: 20 hours ago
:::::: commit date: 20 hours ago
config: s390-randconfig-002-20260721 (https://download.01.org/0day-ci/archive/20260722/[email protected]/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260722/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/hwmon/cros_ec_hwmon.c:164:3: error: call to '__compiletime_assert_374' declared with 'error' attribute: BUILD_BUG_ON failed: sizeof(long) == 8
     164 |                 BUILD_BUG_ON(sizeof(long) == 8);
         |                 ^
   include/linux/build_bug.h:51:2: note: expanded from macro 'BUILD_BUG_ON'
      51 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
         |         ^
   include/linux/build_bug.h:40:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
      40 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^
   include/linux/compiler_types.h:702:2: note: expanded from macro 'compiletime_assert'
     702 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^
   include/linux/compiler_types.h:690:2: note: expanded from macro '_compiletime_assert'
     690 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ^
   include/linux/compiler_types.h:683:4: note: expanded from macro '__compiletime_assert'
     683 |                         prefix ## suffix();                             \
         |                         ^
   <scratch space>:67:1: note: expanded from here
      67 | __compiletime_assert_374
         | ^
   1 error generated.


vim +164 drivers/hwmon/cros_ec_hwmon.c

40d2641468f659 Thomas Weißschuh 2026-06-30  155  
28e1174f3fb106 Thomas Weißschuh 2026-07-03  156  static __always_inline bool cros_ec_hwmon_kelvin_to_millicelsius_overflow(long t, long *ret)
40d2641468f659 Thomas Weißschuh 2026-06-30  157  {
28e1174f3fb106 Thomas Weißschuh 2026-07-03  158  	if (check_mul_overflow(t, MILLIDEGREE_PER_DEGREE, ret)) {
28e1174f3fb106 Thomas Weißschuh 2026-07-03  159  		BUILD_BUG_ON(sizeof(long) == 8);
2848afbe6714f7 Thomas Weißschuh 2026-06-15  160  		return true;
28e1174f3fb106 Thomas Weißschuh 2026-07-03  161  	}
2848afbe6714f7 Thomas Weißschuh 2026-06-15  162  
28e1174f3fb106 Thomas Weißschuh 2026-07-03  163  	if (check_add_overflow(*ret, CROS_EC_HWMON_ABSOLUTE_ZERO_MILLICELSIUS, ret)) {
28e1174f3fb106 Thomas Weißschuh 2026-07-03 @164  		BUILD_BUG_ON(sizeof(long) == 8);
2848afbe6714f7 Thomas Weißschuh 2026-06-15  165  		return true;
28e1174f3fb106 Thomas Weißschuh 2026-07-03  166  	}
2848afbe6714f7 Thomas Weißschuh 2026-06-15  167  
2848afbe6714f7 Thomas Weißschuh 2026-06-15  168  	return false;
40d2641468f659 Thomas Weißschuh 2026-06-30  169  }
40d2641468f659 Thomas Weißschuh 2026-06-30  170  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki