Re: [PATCH 2/4] iio: adc: ad4695: implement calibration support

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

 



On Wed, 21 Aug 2024 12:21:09 +0800
kernel test robot <lkp@xxxxxxxxx> wrote:

> Hi David,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on 0f718e10da81446df0909c9939dff2b77e3b4e95]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/David-Lechner/iio-adc-ad4695-add-2nd-regmap-for-16-bit-registers/20240821-000102
> base:   0f718e10da81446df0909c9939dff2b77e3b4e95
> patch link:    https://lore.kernel.org/r/20240820-ad4695-gain-offset-v1-2-c8f6e3b47551%40baylibre.com
> patch subject: [PATCH 2/4] iio: adc: ad4695: implement calibration support
> config: i386-buildonly-randconfig-002-20240821 (https://download.01.org/0day-ci/archive/20240821/202408211207.fmYTjQDK-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/20240821/202408211207.fmYTjQDK-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/202408211207.fmYTjQDK-lkp@xxxxxxxxx/
> 
> All warnings (new ones prefixed by >>):
> 
> >> drivers/iio/adc/ad4695.c:735:6: warning: unused variable 'ret' [-Wunused-variable]  
>      735 |         int ret;
>          |             ^~~
>    1 warning generated.
I dropped this whilst applying.

> 
> 
> vim +/ret +735 drivers/iio/adc/ad4695.c
> 
>    728	
>    729	static int ad4695_write_raw(struct iio_dev *indio_dev,
>    730				    struct iio_chan_spec const *chan,
>    731				    int val, int val2, long mask)
>    732	{
>    733		struct ad4695_state *st = iio_priv(indio_dev);
>    734		unsigned int reg_val;
>  > 735		int ret;  
>    736	
>    737		iio_device_claim_direct_scoped(return -EBUSY, indio_dev) {
>    738			switch (mask) {
>    739			case IIO_CHAN_INFO_CALIBSCALE:
>    740				switch (chan->type) {
>    741				case IIO_VOLTAGE:
>    742					if (val < 0 || val2 < 0)
>    743						reg_val = 0;
>    744					else if (val > 1)
>    745						reg_val = U16_MAX;
>    746					else
>    747						reg_val = (val * (1 << 16) +
>    748							   mul_u64_u32_div(val2, 1 << 16,
>    749									   MICRO)) / 2;
>    750	
>    751					return regmap_write(st->regmap16,
>    752						AD4695_REG_GAIN_IN(chan->scan_index),
>    753						reg_val);
>    754				default:
>    755					return -EINVAL;
>    756				}
>    757			case IIO_CHAN_INFO_CALIBBIAS:
>    758				switch (chan->type) {
>    759				case IIO_VOLTAGE:
>    760					if (val2 >= 0 && val > S16_MAX / 4)
>    761						reg_val = S16_MAX;
>    762					else if ((val2 < 0 ? -val : val) < S16_MIN / 4)
>    763						reg_val = S16_MIN;
>    764					else if (val2 < 0)
>    765						reg_val = clamp_t(int,
>    766							-(val * 4 + -val2 * 4 / MICRO),
>    767							S16_MIN, S16_MAX);
>    768					else if (val < 0)
>    769						reg_val = clamp_t(int,
>    770							val * 4 - val2 * 4 / MICRO,
>    771							S16_MIN, S16_MAX);
>    772					else
>    773						reg_val = clamp_t(int,
>    774							val * 4 + val2 * 4 / MICRO,
>    775							S16_MIN, S16_MAX);
>    776	
>    777					return regmap_write(st->regmap16,
>    778						AD4695_REG_OFFSET_IN(chan->scan_index),
>    779						reg_val);
>    780				default:
>    781					return -EINVAL;
>    782				}
>    783			default:
>    784				return -EINVAL;
>    785			}
>    786		}
>    787		unreachable();
>    788	}
>    789	
> 





[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