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

kernel test robot <[email protected]>
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:   f509e4c5cf112ac16f4d049c2ef6eb6dfdb6e6ad
commit: f509e4c5cf112ac16f4d049c2ef6eb6dfdb6e6ad [4/4] x
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: sparc64-allmodconfig (https://download.01.org/0day-ci/archive/20260703/[email protected]/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260703/[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:163:3: error: call to '__compiletime_assert_341' declared with 'error' attribute: BUILD_BUG_ON failed: sizeof(long) == 8
     163 |                 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>:73:1: note: expanded from here
      73 | __compiletime_assert_341
         | ^
   drivers/hwmon/cros_ec_hwmon.c:158:3: error: call to '__compiletime_assert_340' declared with 'error' attribute: BUILD_BUG_ON failed: sizeof(long) == 8
     158 |                 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>:69:1: note: expanded from here
      69 | __compiletime_assert_340
         | ^
   2 errors generated.


vim +163 drivers/hwmon/cros_ec_hwmon.c

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

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.