Re: [PATCH 2/3] iio: adc: ltc2309: switch to new .probe()

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

 



Hi Liam,

kernel test robot noticed the following build warnings:

[auto build test WARNING on a5e505a99ca748583dbe558b691be1b26f05d678]

url:    https://github.com/intel-lab-lkp/linux/commits/Liam-Beguin/iio-adc-add-ltc2309-support/20230825-005720
base:   a5e505a99ca748583dbe558b691be1b26f05d678
patch link:    https://lore.kernel.org/r/20230824-ltc2309-v1-2-b87b4eb8030c%40gmail.com
patch subject: [PATCH 2/3] iio: adc: ltc2309: switch to new .probe()
config: i386-randconfig-061-20230906 (https://download.01.org/0day-ci/archive/20230906/202309060456.UYGqTIBd-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230906/202309060456.UYGqTIBd-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/202309060456.UYGqTIBd-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/iio/adc/ltc2309.c:138:24: sparse: sparse: cast to restricted __be16

vim +138 drivers/iio/adc/ltc2309.c

a967828958b014 Liam Beguin 2023-08-24  106  
a967828958b014 Liam Beguin 2023-08-24  107  static int ltc2309_read_raw(struct iio_dev *indio_dev,
a967828958b014 Liam Beguin 2023-08-24  108  			    struct iio_chan_spec const *chan, int *val,
a967828958b014 Liam Beguin 2023-08-24  109  			    int *val2, long mask)
a967828958b014 Liam Beguin 2023-08-24  110  {
a967828958b014 Liam Beguin 2023-08-24  111  	struct ltc2309 *ltc2309 = iio_priv(indio_dev);
a967828958b014 Liam Beguin 2023-08-24  112  	u16 buf;
a967828958b014 Liam Beguin 2023-08-24  113  	int ret;
a967828958b014 Liam Beguin 2023-08-24  114  	u8 din;
a967828958b014 Liam Beguin 2023-08-24  115  
a967828958b014 Liam Beguin 2023-08-24  116  	mutex_lock(&ltc2309->lock);
a967828958b014 Liam Beguin 2023-08-24  117  
a967828958b014 Liam Beguin 2023-08-24  118  	switch (mask) {
a967828958b014 Liam Beguin 2023-08-24  119  	case IIO_CHAN_INFO_RAW:
a967828958b014 Liam Beguin 2023-08-24  120  		din = FIELD_PREP(LTC2309_DIN_CH_MASK, chan->address & 0x0f) |
a967828958b014 Liam Beguin 2023-08-24  121  			FIELD_PREP(LTC2309_DIN_UNI, 1) |
a967828958b014 Liam Beguin 2023-08-24  122  			FIELD_PREP(LTC2309_DIN_SLEEP, 0);
a967828958b014 Liam Beguin 2023-08-24  123  
a967828958b014 Liam Beguin 2023-08-24  124  		ret = i2c_smbus_write_byte(ltc2309->client, din);
a967828958b014 Liam Beguin 2023-08-24  125  		if (ret < 0) {
a967828958b014 Liam Beguin 2023-08-24  126  			dev_err(ltc2309->dev, "i2c command failed: %pe\n",
a967828958b014 Liam Beguin 2023-08-24  127  				ERR_PTR(ret));
a967828958b014 Liam Beguin 2023-08-24  128  			goto out;
a967828958b014 Liam Beguin 2023-08-24  129  		}
a967828958b014 Liam Beguin 2023-08-24  130  
a967828958b014 Liam Beguin 2023-08-24  131  		ret = i2c_master_recv(ltc2309->client, (char *)&buf, 2);
a967828958b014 Liam Beguin 2023-08-24  132  		if (ret < 0) {
a967828958b014 Liam Beguin 2023-08-24  133  			dev_err(ltc2309->dev, "i2c read failed: %pe\n",
a967828958b014 Liam Beguin 2023-08-24  134  				ERR_PTR(ret));
a967828958b014 Liam Beguin 2023-08-24  135  			goto out;
a967828958b014 Liam Beguin 2023-08-24  136  		}
a967828958b014 Liam Beguin 2023-08-24  137  
a967828958b014 Liam Beguin 2023-08-24 @138  		*val = be16_to_cpu(buf) >> 4;
a967828958b014 Liam Beguin 2023-08-24  139  
a967828958b014 Liam Beguin 2023-08-24  140  		ret = IIO_VAL_INT;
a967828958b014 Liam Beguin 2023-08-24  141  		break;
a967828958b014 Liam Beguin 2023-08-24  142  	case IIO_CHAN_INFO_SCALE:
a967828958b014 Liam Beguin 2023-08-24  143  		*val = ltc2309->vref_mv;
a967828958b014 Liam Beguin 2023-08-24  144  		*val2 = LTC2309_ADC_RESOLUTION;
a967828958b014 Liam Beguin 2023-08-24  145  		ret = IIO_VAL_FRACTIONAL_LOG2;
a967828958b014 Liam Beguin 2023-08-24  146  		break;
a967828958b014 Liam Beguin 2023-08-24  147  	default:
a967828958b014 Liam Beguin 2023-08-24  148  		ret = -EINVAL;
a967828958b014 Liam Beguin 2023-08-24  149  		break;
a967828958b014 Liam Beguin 2023-08-24  150  	}
a967828958b014 Liam Beguin 2023-08-24  151  
a967828958b014 Liam Beguin 2023-08-24  152  out:
a967828958b014 Liam Beguin 2023-08-24  153  	mutex_unlock(&ltc2309->lock);
a967828958b014 Liam Beguin 2023-08-24  154  	return ret;
a967828958b014 Liam Beguin 2023-08-24  155  }
a967828958b014 Liam Beguin 2023-08-24  156  

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