linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 6248/7300] drivers/hwmon/max31827.c:394:16: sparse: sparse: dubious: x & !y
@ 2023-12-13 22:30 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-13 22:30 UTC (permalink / raw)
  To: Daniel Matyas; +Cc: oe-kbuild-all, Linux Memory Management List, Guenter Roeck

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   48e8992e33abf054bcc0bb2e77b2d43bb899212e
commit: 88548710d2aed71677f7594a78219bf081d4297f [6248/7300] hwmon: (max31827) Handle new properties from the devicetree
config: arc-randconfig-r131-20231212 (https://download.01.org/0day-ci/archive/20231214/202312140633.nmHowPIh-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231214/202312140633.nmHowPIh-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/202312140633.nmHowPIh-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/hwmon/max31827.c:394:16: sparse: sparse: dubious: x & !y
   drivers/hwmon/max31827.c:401:24: sparse: sparse: dubious: x & !y

vim +394 drivers/hwmon/max31827.c

   373	
   374	static int max31827_init_client(struct max31827_state *st,
   375					struct device *dev)
   376	{
   377		struct fwnode_handle *fwnode;
   378		unsigned int res = 0;
   379		u32 data, lsb_idx;
   380		bool prop;
   381		int ret;
   382	
   383		fwnode = dev_fwnode(dev);
   384	
   385		st->enable = true;
   386		res |= MAX31827_DEVICE_ENABLE(1);
   387	
   388		res |= MAX31827_CONFIGURATION_RESOLUTION_MASK;
   389	
   390		prop = fwnode_property_read_bool(fwnode, "adi,comp-int");
   391		res |= FIELD_PREP(MAX31827_CONFIGURATION_COMP_INT_MASK, prop);
   392	
   393		prop = fwnode_property_read_bool(fwnode, "adi,timeout-enable");
 > 394		res |= FIELD_PREP(MAX31827_CONFIGURATION_TIMEOUT_MASK, !prop);
   395	
   396		if (fwnode_property_present(fwnode, "adi,alarm-pol")) {
   397			ret = fwnode_property_read_u32(fwnode, "adi,alarm-pol", &data);
   398			if (ret)
   399				return ret;
   400	
   401			res |= FIELD_PREP(MAX31827_CONFIGURATION_ALRM_POL_MASK, !!data);
   402		} else {
   403			/*
   404			 * Set default value.
   405			 */
   406			res |= FIELD_PREP(MAX31827_CONFIGURATION_ALRM_POL_MASK,
   407					  MAX31827_ALRM_POL_LOW);
   408		}
   409	
   410		if (fwnode_property_present(fwnode, "adi,fault-q")) {
   411			ret = fwnode_property_read_u32(fwnode, "adi,fault-q", &data);
   412			if (ret)
   413				return ret;
   414	
   415			/*
   416			 * Convert the desired fault queue into register bits.
   417			 */
   418			if (data != 0)
   419				lsb_idx = __ffs(data);
   420	
   421			if (hweight32(data) != 1 || lsb_idx > 4) {
   422				dev_err(dev, "Invalid data in adi,fault-q\n");
   423				return -EINVAL;
   424			}
   425	
   426			res |= FIELD_PREP(MAX31827_CONFIGURATION_FLT_Q_MASK, lsb_idx);
   427		} else {
   428			/*
   429			 * Set default value.
   430			 */
   431			res |= FIELD_PREP(MAX31827_CONFIGURATION_FLT_Q_MASK,
   432					  MAX31827_FLT_Q_1);
   433		}
   434	
   435		return regmap_write(st->regmap, MAX31827_CONFIGURATION_REG, res);
   436	}
   437	

-- 
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:[~2023-12-13 22:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 22:30 [linux-next:master 6248/7300] drivers/hwmon/max31827.c:394:16: sparse: sparse: dubious: x & !y 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