Re: [PATCH v2 5/5] iio: dac: ltc2664: Add driver for LTC2664 and LTC2672

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

 



Hi Kim,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 827dca3129708a8465bde90c86c2e3c38e62dd4f]

url:    https://github.com/intel-lab-lkp/linux/commits/Kim-Seer-Paller/iio-ABI-Generalize-ABI-documentation-for-DAC/20240523-112246
base:   827dca3129708a8465bde90c86c2e3c38e62dd4f
patch link:    https://lore.kernel.org/r/20240523031909.19427-6-kimseer.paller%40analog.com
patch subject: [PATCH v2 5/5] iio: dac: ltc2664: Add driver for LTC2664 and LTC2672
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240524/202405241141.kYcxrSem-lkp@xxxxxxxxx/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 7aa382fd7257d9bd4f7fc50bb7078a3c26a1628c)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240524/202405241141.kYcxrSem-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405241141.kYcxrSem-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   In file included from drivers/iio/dac/ltc2664.c:20:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2208:
   include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     508 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     509 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     515 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     516 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     522 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     527 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     528 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     536 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     537 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/iio/dac/ltc2664.c:627:8: warning: variable 'span' is uninitialized when used here [-Wuninitialized]
     627 |                         if (span < 0)
         |                             ^~~~
   drivers/iio/dac/ltc2664.c:563:15: note: initialize the variable 'span' to silence this warning
     563 |         int ret, span;
         |                      ^
         |                       = 0
   6 warnings generated.


vim +/span +627 drivers/iio/dac/ltc2664.c

   557	
   558	static int ltc2664_channel_config(struct ltc2664_state *st)
   559	{
   560		const struct ltc2664_chip_info *chip_info = st->chip_info;
   561		struct device *dev = &st->spi->dev;
   562		u32 reg, tmp[2], mspan;
   563		int ret, span;
   564	
   565		mspan = LTC2664_MSPAN_SOFTSPAN;
   566		ret = device_property_read_u32(dev, "adi,manual-span-operation-config",
   567					       &mspan);
   568		if (!ret) {
   569			if (!chip_info->manual_span_support)
   570				return dev_err_probe(dev, -EINVAL,
   571				       "adi,manual-span-operation-config not supported\n");
   572	
   573			if (mspan > ARRAY_SIZE(ltc2664_mspan_lut))
   574				return dev_err_probe(dev, -EINVAL,
   575				       "adi,manual-span-operation-config not in range\n");
   576		}
   577	
   578		st->rfsadj = 20000;
   579		ret = device_property_read_u32(dev, "adi,rfsadj-ohms", &st->rfsadj);
   580		if (!ret) {
   581			if (!chip_info->rfsadj_support)
   582				return dev_err_probe(dev, -EINVAL,
   583						     "adi,rfsadj-ohms not supported\n");
   584	
   585			if (st->rfsadj < 19000 || st->rfsadj > 41000)
   586				return dev_err_probe(dev, -EINVAL,
   587						     "adi,rfsadj-ohms not in range\n");
   588		}
   589	
   590		device_for_each_child_node_scoped(dev, child) {
   591			struct ltc2664_chan *chan;
   592	
   593			ret = fwnode_property_read_u32(child, "reg", &reg);
   594			if (ret)
   595				return dev_err_probe(dev, ret,
   596						     "Failed to get reg property\n");
   597	
   598			if (reg >= chip_info->num_channels)
   599				return dev_err_probe(dev, -EINVAL,
   600						     "reg bigger than: %d\n",
   601						     chip_info->num_channels);
   602	
   603			chan = &st->channels[reg];
   604	
   605			if (fwnode_property_read_bool(child, "adi,toggle-mode")) {
   606				chan->toggle_chan = true;
   607				/* assume sw toggle ABI */
   608				st->iio_channels[reg].ext_info = ltc2664_toggle_sym_ext_info;
   609				/*
   610				 * Clear IIO_CHAN_INFO_RAW bit as toggle channels expose
   611				 * out_voltage/current_raw{0|1} files.
   612				 */
   613				__clear_bit(IIO_CHAN_INFO_RAW,
   614					    &st->iio_channels[reg].info_mask_separate);
   615			}
   616	
   617			chan->raw[0] = ltc2664_mspan_lut[mspan][1];
   618			chan->raw[1] = ltc2664_mspan_lut[mspan][1];
   619	
   620			chan->span = ltc2664_mspan_lut[mspan][0];
   621	
   622			ret = fwnode_property_read_u32_array(child, "adi,output-range-microvolt",
   623							     tmp, ARRAY_SIZE(tmp));
   624			if (!ret && mspan == LTC2664_MSPAN_SOFTSPAN) {
   625				chan->span = ltc2664_set_span(st, tmp[0] / 1000,
   626							      tmp[1] / 1000, reg);
 > 627				if (span < 0)
   628					return dev_err_probe(dev, span,
   629							     "Failed to set span\n");
   630	
   631			}
   632	
   633			ret = fwnode_property_read_u32(child,
   634						       "adi,output-range-microamp",
   635						       &tmp[0]);
   636			if (!ret) {
   637				chan->span = ltc2664_set_span(st, 0, tmp[0] / 1000, reg);
   638				if (span < 0)
   639					return dev_err_probe(dev, span,
   640							     "Failed to set span\n");
   641			}
   642		}
   643	
   644		return 0;
   645	}
   646	

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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux