Re: [PATCH 7/7] iio: adc: ad7606: add support for AD7606C-{16,18} parts

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

 



Hi Alexandru,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[cannot apply to linus/master v6.11-rc4 next-20240819]
[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/Alexandru-Ardelean/iio-adc-ad7606-add-bits-parameter-to-channels-macros/20240819-145028
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20240819064721.91494-8-aardelean%40baylibre.com
patch subject: [PATCH 7/7] iio: adc: ad7606: add support for AD7606C-{16,18} parts
config: i386-buildonly-randconfig-001-20240819 (https://download.01.org/0day-ci/archive/20240819/202408192209.IrTzVL49-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240819/202408192209.IrTzVL49-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/202408192209.IrTzVL49-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/iio/adc/ad7606.c:796:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     796 |         int ret, ch;
         |             ^
   1 warning generated.


vim +/ret +796 drivers/iio/adc/ad7606.c

94168a5789874a Alexandru Ardelean 2024-08-19  790  
94168a5789874a Alexandru Ardelean 2024-08-19  791  static int ad7606_sw_mode_setup(struct iio_dev *indio_dev, unsigned int id)
b5d2c422286d62 Alexandru Ardelean 2024-08-19  792  {
36b63bb57295f7 Alexandru Ardelean 2024-08-19  793  	unsigned int num_channels = indio_dev->num_channels - 1;
b5d2c422286d62 Alexandru Ardelean 2024-08-19  794  	struct ad7606_state *st = iio_priv(indio_dev);
09d11fa081ef17 Alexandru Ardelean 2024-08-19  795  	unsigned int *scale_avail_show, num_scales_avail_show;
09d11fa081ef17 Alexandru Ardelean 2024-08-19 @796  	int ret, ch;
b5d2c422286d62 Alexandru Ardelean 2024-08-19  797  
b5d2c422286d62 Alexandru Ardelean 2024-08-19  798  	if (!st->bops->sw_mode_config)
b5d2c422286d62 Alexandru Ardelean 2024-08-19  799  		return 0;
b5d2c422286d62 Alexandru Ardelean 2024-08-19  800  
b5d2c422286d62 Alexandru Ardelean 2024-08-19  801  	st->sw_mode_en = device_property_present(st->dev, "adi,sw-mode");
b5d2c422286d62 Alexandru Ardelean 2024-08-19  802  	if (!st->sw_mode_en)
b5d2c422286d62 Alexandru Ardelean 2024-08-19  803  		return 0;
b5d2c422286d62 Alexandru Ardelean 2024-08-19  804  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  805  	indio_dev->info = &ad7606_info_sw_mode;
b5d2c422286d62 Alexandru Ardelean 2024-08-19  806  
94168a5789874a Alexandru Ardelean 2024-08-19  807  	switch (id) {
94168a5789874a Alexandru Ardelean 2024-08-19  808  	case ID_AD7606C_18:
94168a5789874a Alexandru Ardelean 2024-08-19  809  		num_scales_avail_show = num_channels;
94168a5789874a Alexandru Ardelean 2024-08-19  810  		ret = ad7606c_sw_mode_setup_channels(indio_dev,
94168a5789874a Alexandru Ardelean 2024-08-19  811  						     ad7606c_18_chan_setup);
94168a5789874a Alexandru Ardelean 2024-08-19  812  		break;
94168a5789874a Alexandru Ardelean 2024-08-19  813  	case ID_AD7606C_16:
94168a5789874a Alexandru Ardelean 2024-08-19  814  		num_scales_avail_show = num_channels;
94168a5789874a Alexandru Ardelean 2024-08-19  815  		ret = ad7606c_sw_mode_setup_channels(indio_dev,
94168a5789874a Alexandru Ardelean 2024-08-19  816  						     ad7606c_16_chan_setup);
94168a5789874a Alexandru Ardelean 2024-08-19  817  		break;
94168a5789874a Alexandru Ardelean 2024-08-19  818  	default:
94168a5789874a Alexandru Ardelean 2024-08-19  819  		num_scales_avail_show = 1;
94168a5789874a Alexandru Ardelean 2024-08-19  820  
b5d2c422286d62 Alexandru Ardelean 2024-08-19  821  		/* Scale of 0.076293 is only available in sw mode */
b5d2c422286d62 Alexandru Ardelean 2024-08-19  822  		/* After reset, in software mode, ±10 V is set by default */
36b63bb57295f7 Alexandru Ardelean 2024-08-19  823  		for (ch = 0; ch < num_channels; ch++) {
36b63bb57295f7 Alexandru Ardelean 2024-08-19  824  			struct ad7606_chan_scale *cs = &st->chan_scales[ch];
36b63bb57295f7 Alexandru Ardelean 2024-08-19  825  
36b63bb57295f7 Alexandru Ardelean 2024-08-19  826  			cs->scale_avail = ad7616_sw_scale_avail;
36b63bb57295f7 Alexandru Ardelean 2024-08-19  827  			cs->num_scales = ARRAY_SIZE(ad7616_sw_scale_avail);
36b63bb57295f7 Alexandru Ardelean 2024-08-19  828  			cs->range = 2;
36b63bb57295f7 Alexandru Ardelean 2024-08-19  829  		}
b5d2c422286d62 Alexandru Ardelean 2024-08-19  830  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  831  		ret = st->bops->sw_mode_config(indio_dev);
94168a5789874a Alexandru Ardelean 2024-08-19  832  		break;
94168a5789874a Alexandru Ardelean 2024-08-19  833  	}
09d11fa081ef17 Alexandru Ardelean 2024-08-19  834  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  835  	for (ch = 0; ch < num_channels; ch++) {
09d11fa081ef17 Alexandru Ardelean 2024-08-19  836  		struct ad7606_chan_scale *cs;
09d11fa081ef17 Alexandru Ardelean 2024-08-19  837  		int i;
09d11fa081ef17 Alexandru Ardelean 2024-08-19  838  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  839  		/* AD7606C supports different scales per channel */
09d11fa081ef17 Alexandru Ardelean 2024-08-19  840  		cs = &st->chan_scales[ch];
09d11fa081ef17 Alexandru Ardelean 2024-08-19  841  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  842  		if (num_scales_avail_show == 1 && ch > 0) {
09d11fa081ef17 Alexandru Ardelean 2024-08-19  843  			cs->scale_avail_show = scale_avail_show;
09d11fa081ef17 Alexandru Ardelean 2024-08-19  844  			continue;
09d11fa081ef17 Alexandru Ardelean 2024-08-19  845  		}
09d11fa081ef17 Alexandru Ardelean 2024-08-19  846  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  847  		scale_avail_show = devm_kcalloc(st->dev, cs->num_scales * 2,
09d11fa081ef17 Alexandru Ardelean 2024-08-19  848  						sizeof(*scale_avail_show),
09d11fa081ef17 Alexandru Ardelean 2024-08-19  849  						GFP_KERNEL);
09d11fa081ef17 Alexandru Ardelean 2024-08-19  850  		if (!scale_avail_show)
09d11fa081ef17 Alexandru Ardelean 2024-08-19  851  			return -ENOMEM;
09d11fa081ef17 Alexandru Ardelean 2024-08-19  852  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  853  		/* Generate a scale_avail list for showing to userspace */
09d11fa081ef17 Alexandru Ardelean 2024-08-19  854  		for (i = 0; i < cs->num_scales; i++) {
09d11fa081ef17 Alexandru Ardelean 2024-08-19  855  			scale_avail_show[i * 2] = 0;
09d11fa081ef17 Alexandru Ardelean 2024-08-19  856  			scale_avail_show[i * 2 + 1] = cs->scale_avail[i];
09d11fa081ef17 Alexandru Ardelean 2024-08-19  857  		}
09d11fa081ef17 Alexandru Ardelean 2024-08-19  858  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  859  		cs->scale_avail_show = scale_avail_show;
09d11fa081ef17 Alexandru Ardelean 2024-08-19  860  	}
09d11fa081ef17 Alexandru Ardelean 2024-08-19  861  
09d11fa081ef17 Alexandru Ardelean 2024-08-19  862  	return 0;
b5d2c422286d62 Alexandru Ardelean 2024-08-19  863  }
b5d2c422286d62 Alexandru Ardelean 2024-08-19  864  

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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux