[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241109132105.0a6bfc0b@jic23-huawei>
Date: Sat, 9 Nov 2024 13:21:05 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Javier Carrasco <javier.carrasco.cruz@...il.com>
Cc: kernel test robot <lkp@...el.com>, Lars-Peter Clausen <lars@...afoo.de>,
oe-kbuild-all@...ts.linux.dev, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: light: veml6030: add support for triggered buffer
On Fri, 8 Nov 2024 11:33:27 +0100
Javier Carrasco <javier.carrasco.cruz@...il.com> wrote:
> On 08/11/2024 10:41, kernel test robot wrote:
> > Hi Javier,
> >
> > kernel test robot noticed the following build warnings:
> >
> > [auto build test WARNING on c9f8285ec18c08fae0de08835eb8e5953339e664]
> >
> > url: https://github.com/intel-lab-lkp/linux/commits/Javier-Carrasco/iio-light-veml6030-add-support-for-triggered-buffer/20241108-042332
> > base: c9f8285ec18c08fae0de08835eb8e5953339e664
> > patch link: https://lore.kernel.org/r/20241107-veml6030_triggered_buffer-v1-1-4810ab86cc56%40gmail.com
> > patch subject: [PATCH] iio: light: veml6030: add support for triggered buffer
> > config: i386-randconfig-062-20241108 (https://download.01.org/0day-ci/archive/20241108/202411081703.Ft0YjqcK-lkp@intel.com/config)
> > compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241108/202411081703.Ft0YjqcK-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@...el.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202411081703.Ft0YjqcK-lkp@intel.com/
> >
> > sparse warnings: (new ones prefixed by >>)
> >>> drivers/iio/light/veml6030.c:958:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 @@ got int [addressable] reg @@
> > drivers/iio/light/veml6030.c:958:39: sparse: expected restricted __le16
> > drivers/iio/light/veml6030.c:958:39: sparse: got int [addressable] reg
> >
> > vim +958 drivers/iio/light/veml6030.c
> >
> > 944
> > 945 static irqreturn_t veml6030_trigger_handler(int irq, void *p)
> > 946 {
> > 947 struct iio_poll_func *pf = p;
> > 948 struct iio_dev *iio = pf->indio_dev;
> > 949 struct veml6030_data *data = iio_priv(iio);
> > 950 int i, ret, reg;
> > 951 int j = 0;
> > 952
> > 953 iio_for_each_active_channel(iio, i) {
> > 954 ret = regmap_read(data->regmap, VEML6030_REG_DATA(i), ®);
> > 955 if (ret)
> > 956 goto done;
> > 957
> > > 958 data->scan.chans[j++] = reg;
>
> chans is currently declared as __le16 chans[2], but it should be u16
> chans[2], as regmap already handles the endianness.
>
> Then the direct assignment does not raise any warnings. When at it, I
> will define reg as unsigned int.
Make sure you update the chan_spec as well to reflect that are CPU endian.
This makes sense because the registers are 16 bit on this device.
>
> > 959 }
> > 960
> > 961 iio_push_to_buffers_with_timestamp(iio, &data->scan, pf->timestamp);
> > 962
> > 963 done:
> > 964 iio_trigger_notify_done(iio->trig);
> > 965
> > 966 return IRQ_HANDLED;
> > 967 }
> > 968
> >
>
> Best regards,
> Javier Carrasco
>
Powered by blists - more mailing lists