Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH 2/3] power: supply: cw2217: Add support for Cellwise cw2217
       [not found] <20261027131751.1724448-3-macroalpha82@gmail.com>
@ 2026-10-29  6:24 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-29  6:24 UTC (permalink / raw)
  To: Chris Morgan, linux-pm
  Cc: llvm, oe-kbuild-all, devicetree, linux-rockchip, heiko, conor+dt,
	krzk+dt, robh, sre, t.schramm, Chris Morgan

Hi Chris,

kernel test robot noticed the following build errors:

[auto build test ERROR on sre-power-supply/for-next]
[also build test ERROR on rockchip/for-next amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v7.3 next-20261028]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Chris-Morgan/dt-bindings-power-cw2015-add-cw2215-cw2217-and-cw2218/20261027-081749
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
patch link:    https://lore.kernel.org/r/20261027131751.1724448-3-macroalpha82%40gmail.com
patch subject: [PATCH 2/3] power: supply: cw2217: Add support for Cellwise cw2217
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20261029/202610291456.pByroJTe-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 1da436a23e613c425fc9b868fc8deb979ede47a4)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261029/202610291456.pByroJTe-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610291456.pByroJTe-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/power/supply/cw2217_battery.c:261:11: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     261 |         fw_ver = FIELD_GET(CW2217_ID_MASK, cw_bat->fw_version);
         |                  ^
   drivers/power/supply/cw2217_battery.c:465:12: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     465 |                                        FIELD_GET(CW2217_IC_READY_MASK, reg) == CW2217_IC_READY,
         |                                        ^
   drivers/power/supply/cw2217_battery.c:491:6: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     491 |         if (FIELD_GET(CW2217_CONFIG_ACT_MSK, reg)) {
         |             ^
   3 errors generated.


vim +/FIELD_GET +261 drivers/power/supply/cw2217_battery.c

   231	
   232	/*
   233	 * Current is a signed 16bit register (0x0E 0x0F) that reports current A/D
   234	 * converter result of the voltage across the current sense resistor,
   235	 * 10mohm typical. The register value should be divided by the sense
   236	 * resistance to convert to amperes. The value of the sense resistor
   237	 * determines the resolution and the full-scale range of the current readings.
   238	 * The LSB of 0x0F is (52.4/32768)uV for CW2215 and CW2217. The LSB of 0x0F is
   239	 * (125/32768)uV for CW2218.
   240	 */
   241	static int cw2217_get_current(struct cw2217_battery *cw_bat)
   242	{
   243		s32 cw_current;
   244		__be16 reg;
   245		u8 fw_ver;
   246		int ret;
   247	
   248		if (cw_bat->fw_version == 0) {
   249			cw_bat->cw_current = 0;
   250			dev_err(cw_bat->dev, "Error! CW2217 firmware read error!\n");
   251			return -EIO;
   252		}
   253	
   254		ret = regmap_bulk_read(cw_bat->regmap, CW2217_CURRENT_H,
   255				       &reg, sizeof(reg));
   256		if (ret)
   257			return ret;
   258	
   259		cw_current = (s16)be16_to_cpu(reg);
   260	
 > 261		fw_ver = FIELD_GET(CW2217_ID_MASK, cw_bat->fw_version);
   262		switch (fw_ver) {
   263		case CW2215_ID:
   264		case CW2217_ID:
   265			cw_current = (cw_current * 1600) / (cw_bat->user_rsense / 1000);
   266			cw_bat->cw_current = cw_current * 1000;
   267			break;
   268		case CW2218_ID:
   269			cw_current = (cw_current * 3815) / (cw_bat->user_rsense / 1000);
   270			cw_bat->cw_current = cw_current * 1000;
   271			break;
   272		default:
   273			cw_bat->cw_current = 0;
   274			dev_err(cw_bat->dev, "Error! CW2217 firmware read error!\n");
   275			return -EIO;
   276		}
   277	
   278		return 0;
   279	}
   280	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-29  6:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261027131751.1724448-3-macroalpha82@gmail.com>
2026-10-29  6:24 ` [PATCH 2/3] power: supply: cw2217: Add support for Cellwise cw2217 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox