[linux-stable-rc:linux-5.4.y 4610/22976] include/linux/compiler.h:350:45: error: call to '__compiletime_assert_253' declared with attribute error: FIELD_GET: mask is not constant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vegard,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
head:   73330daa339307fbff4ff7f1775da1dead794691
commit: 3910babeac1ab031f4e178042cbd1af9a9a0ec51 [4610/22976] compiler.h: fix error in BUILD_BUG_ON() reporting
config: i386-randconfig-r015-20230403 (https://download.01.org/0day-ci/archive/20230404/202304040908.quRhblEI-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=3910babeac1ab031f4e178042cbd1af9a9a0ec51
        git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
        git fetch --no-tags linux-stable-rc linux-5.4.y
        git checkout 3910babeac1ab031f4e178042cbd1af9a9a0ec51
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 olddefconfig
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/mt7615/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202304040908.quRhblEI-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from include/linux/export.h:42,
                    from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/skbuff.h:13,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/net/wireless/mediatek/mt76/mt7615/mac.c:10:
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c: In function 'to_rssi':
>> include/linux/compiler.h:350:45: error: call to '__compiletime_assert_253' declared with attribute error: FIELD_GET: mask is not constant
     350 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                                             ^
   include/linux/compiler.h:331:25: note: in definition of macro '__compiletime_assert'
     331 |                         prefix ## suffix();                             \
         |                         ^~~~~~
   include/linux/compiler.h:350:9: note: in expansion of macro '_compiletime_assert'
     350 |         _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/bitfield.h:46:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
      46 |                 BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),          \
         |                 ^~~~~~~~~~~~~~~~
   include/linux/bitfield.h:95:17: note: in expansion of macro '__BF_FIELD_CHECK'
      95 |                 __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
         |                 ^~~~~~~~~~~~~~~~
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:18:17: note: in expansion of macro 'FIELD_GET'
      18 |         return (FIELD_GET(field, rxv) - 220) / 2;
         |                 ^~~~~~~~~
   include/linux/compiler.h:350:45: error: call to '__compiletime_assert_257' declared with attribute error: BUILD_BUG_ON failed: (((field) + (1ULL << (__builtin_ffsll(field) - 1))) & (((field) + (1ULL << (__builtin_ffsll(field) - 1))) - 1)) != 0
     350 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                                             ^
   include/linux/compiler.h:331:25: note: in definition of macro '__compiletime_assert'
     331 |                         prefix ## suffix();                             \
         |                         ^~~~~~
   include/linux/compiler.h:350:9: note: in expansion of macro '_compiletime_assert'
     350 |         _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)
         |         ^~~~~~~~~~~~~~~~
   include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
      21 |         BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
         |         ^~~~~~~~~~~~
   include/linux/bitfield.h:54:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
      54 |                 __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +                 \
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/bitfield.h:95:17: note: in expansion of macro '__BF_FIELD_CHECK'
      95 |                 __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
         |                 ^~~~~~~~~~~~~~~~
   drivers/net/wireless/mediatek/mt76/mt7615/mac.c:18:17: note: in expansion of macro 'FIELD_GET'
      18 |         return (FIELD_GET(field, rxv) - 220) / 2;
         |                 ^~~~~~~~~


vim +/__compiletime_assert_253 +350 include/linux/compiler.h

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

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux