[linux-next:master 1397/13846] drivers/iio/magnetometer/qmc5883l.c:377:8: error: call to '__compiletime_assert_536' declared with 'error' attribute: FIELD_PREP: value too large for the field

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]
TO: Siratul Islam <[email protected]>
CC: Jonathan Cameron <[email protected]>
CC: Andy Shevchenko <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   6b8c8af514d739d0335f5579b585e02babe8a727
commit: e8349f9473423fdd357da33eec628d5ea9c555f5 [1397/13846] iio: magnetometer: add driver for QST QMC5883L Sensor
:::::: branch date: 3 days ago
:::::: commit date: 6 weeks ago
config: s390-randconfig-r051-20260810 (https://download.01.org/0day-ci/archive/20260810/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260810/[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/iio/magnetometer/qmc5883l.c:377:8: error: call to '__compiletime_assert_536' declared with 'error' attribute: FIELD_PREP: value too large for the field
     377 |                             FIELD_PREP(QMC5883L_OSR_MASK, data->osr));
         |                             ^
   include/linux/bitfield.h:138:3: note: expanded from macro 'FIELD_PREP'
     138 |                 __FIELD_PREP(_mask, _val, "FIELD_PREP: ");              \
         |                 ^
   include/linux/bitfield.h:91:3: note: expanded from macro '__FIELD_PREP'
      91 |                 __BF_FIELD_CHECK_MASK(mask, val, pfx);                  \
         |                 ^
   include/linux/bitfield.h:70:3: note: expanded from macro '__BF_FIELD_CHECK_MASK'
      70 |                 BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?           \
         |                 ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   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>:18:1: note: expanded from here
      18 | __compiletime_assert_536
         | ^
   1 error generated.


vim +377 drivers/iio/magnetometer/qmc5883l.c

e8349f9473423f Siratul Islam 2026-06-19  337  
e8349f9473423f Siratul Islam 2026-06-19  338  static int qmc5883l_init(struct qmc5883l_data *data)
e8349f9473423f Siratul Islam 2026-06-19  339  {
e8349f9473423f Siratul Islam 2026-06-19  340  	struct regmap *map = data->regmap;
e8349f9473423f Siratul Islam 2026-06-19  341  	unsigned int reg;
e8349f9473423f Siratul Islam 2026-06-19  342  	int ret;
e8349f9473423f Siratul Islam 2026-06-19  343  
e8349f9473423f Siratul Islam 2026-06-19  344  	ret = regmap_read(map, QMC5883L_REG_ID, &reg);
e8349f9473423f Siratul Islam 2026-06-19  345  	if (ret)
e8349f9473423f Siratul Islam 2026-06-19  346  		return ret;
e8349f9473423f Siratul Islam 2026-06-19  347  
e8349f9473423f Siratul Islam 2026-06-19  348  	/* Not failing because rev 1.0 had this register reserved */
e8349f9473423f Siratul Islam 2026-06-19  349  	if (reg != QMC5883L_CHIP_ID)
e8349f9473423f Siratul Islam 2026-06-19  350  		dev_warn(regmap_get_device(map),
e8349f9473423f Siratul Islam 2026-06-19  351  			 "Unknown chip id: 0x%02x, continuing\n", reg);
e8349f9473423f Siratul Islam 2026-06-19  352  
e8349f9473423f Siratul Islam 2026-06-19  353  	ret = regmap_write(map, QMC5883L_REG_CTRL2, QMC5883L_SOFT_RESET);
e8349f9473423f Siratul Islam 2026-06-19  354  	if (ret)
e8349f9473423f Siratul Islam 2026-06-19  355  		return ret;
e8349f9473423f Siratul Islam 2026-06-19  356  
e8349f9473423f Siratul Islam 2026-06-19  357  	/* Use POR completion time as a conservative bound */
e8349f9473423f Siratul Islam 2026-06-19  358  	fsleep(QMC5883L_PORT_US);
e8349f9473423f Siratul Islam 2026-06-19  359  
e8349f9473423f Siratul Islam 2026-06-19  360  	/* DRDY pin not used in this version of the driver */
e8349f9473423f Siratul Islam 2026-06-19  361  	ret = regmap_write(map, QMC5883L_REG_CTRL2, QMC5883L_INT_DISABLE);
e8349f9473423f Siratul Islam 2026-06-19  362  	if (ret)
e8349f9473423f Siratul Islam 2026-06-19  363  		return ret;
e8349f9473423f Siratul Islam 2026-06-19  364  
e8349f9473423f Siratul Islam 2026-06-19  365  	ret = regmap_write(map, QMC5883L_REG_SET_RESET, QMC5883L_SET_RESET_VAL);
e8349f9473423f Siratul Islam 2026-06-19  366  	if (ret)
e8349f9473423f Siratul Islam 2026-06-19  367  		return ret;
e8349f9473423f Siratul Islam 2026-06-19  368  
e8349f9473423f Siratul Islam 2026-06-19  369  	data->odr = QMC5883L_ODR_50HZ;
e8349f9473423f Siratul Islam 2026-06-19  370  	data->range = QMC5883L_RNG_2G;
e8349f9473423f Siratul Islam 2026-06-19  371  	data->osr = QMC5883L_OSR_64;
e8349f9473423f Siratul Islam 2026-06-19  372  
e8349f9473423f Siratul Islam 2026-06-19  373  	return regmap_write(map, QMC5883L_REG_CTRL1,
e8349f9473423f Siratul Islam 2026-06-19  374  			    FIELD_PREP(QMC5883L_MODE_MASK, QMC5883L_MODE_CONT) |
e8349f9473423f Siratul Islam 2026-06-19  375  			    FIELD_PREP(QMC5883L_ODR_MASK, data->odr) |
e8349f9473423f Siratul Islam 2026-06-19  376  			    FIELD_PREP(QMC5883L_RNG_MASK, data->range) |
e8349f9473423f Siratul Islam 2026-06-19 @377  			    FIELD_PREP(QMC5883L_OSR_MASK, data->osr));
e8349f9473423f Siratul Islam 2026-06-19  378  }
e8349f9473423f Siratul Islam 2026-06-19  379  

--
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.