From: Jonathan Cameron <jic23@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: Marcelo Schmitt <marcelo.schmitt@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
oe-kbuild-all@lists.linux.dev, lars@metafoo.de,
Michael.Hennerich@analog.com, dlechner@baylibre.com,
nuno.sa@analog.com, andy@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
linus.walleij@linaro.org, brgl@bgdev.pl, broonie@kernel.org,
lgirdwood@gmail.com, marcelo.schmitt1@gmail.com
Subject: Re: [PATCH v6 06/12] iio: adc: ad4170: Add digital filter and sample frequency config support
Date: Sun, 22 Jun 2025 15:12:29 +0100 [thread overview]
Message-ID: <20250622151229.4e56e8ae@jic23-huawei> (raw)
In-Reply-To: <202506201000.WjqDvyXl-lkp@intel.com>
On Fri, 20 Jun 2025 10:38:58 +0800
kernel test robot <lkp@intel.com> wrote:
> Hi Marcelo,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on 4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Marcelo-Schmitt/dt-bindings-iio-adc-Add-AD4170/20250619-014200
> base: 4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6
> patch link: https://lore.kernel.org/r/bc0261373936511a6ae5b25082e36ac5f112f6db.1750258776.git.marcelo.schmitt%40analog.com
> patch subject: [PATCH v6 06/12] iio: adc: ad4170: Add digital filter and sample frequency config support
> config: microblaze-randconfig-r133-20250620 (https://download.01.org/0day-ci/archive/20250620/202506201000.WjqDvyXl-lkp@intel.com/config)
> compiler: microblaze-linux-gcc (GCC) 8.5.0
> reproduce: (https://download.01.org/0day-ci/archive/20250620/202506201000.WjqDvyXl-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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202506201000.WjqDvyXl-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> drivers/iio/adc/ad4170.c: In function 'ad4170_read_avail':
> >> drivers/iio/adc/ad4170.c:1237:18: warning: array subscript 4294967274 is above array bounds of 'int[3][18][2]' [-Warray-bounds]
> *vals = (int *)st->sps_tbl[f_type];
> ^~
>
>
> vim +1237 drivers/iio/adc/ad4170.c
>
> 1219
> 1220 static int ad4170_read_avail(struct iio_dev *indio_dev,
> 1221 struct iio_chan_spec const *chan,
> 1222 const int **vals, int *type, int *length,
> 1223 long info)
> 1224 {
> 1225 struct ad4170_state *st = iio_priv(indio_dev);
> 1226 struct ad4170_chan_info *chan_info = &st->chan_infos[chan->address];
> 1227 enum ad4170_filter_type f_type;
> 1228
> 1229 switch (info) {
> 1230 case IIO_CHAN_INFO_SCALE:
> 1231 *vals = (int *)chan_info->scale_tbl;
> 1232 *length = ARRAY_SIZE(chan_info->scale_tbl) * 2;
> 1233 *type = IIO_VAL_INT_PLUS_NANO;
> 1234 return IIO_AVAIL_LIST;
> 1235 case IIO_CHAN_INFO_SAMP_FREQ:
> 1236 f_type = ad4170_get_filter_type(indio_dev, chan);
> > 1237 *vals = (int *)st->sps_tbl[f_type];
I think this needs an error check as the function can return -EINVAL ?
> 1238 *type = IIO_VAL_INT_PLUS_MICRO;
> 1239 switch (f_type) {
> 1240 case AD4170_SINC5_AVG:
> 1241 case AD4170_SINC3:
> 1242 *length = ARRAY_SIZE(ad4170_sinc3_filt_fs_tbl) * 2;
> 1243 return IIO_AVAIL_LIST;
> 1244 case AD4170_SINC5:
> 1245 *length = ARRAY_SIZE(ad4170_sinc5_filt_fs_tbl) * 2;
> 1246 return IIO_AVAIL_LIST;
> 1247 default:
> 1248 return -EINVAL;
> 1249 }
> 1250 default:
> 1251 return -EINVAL;
> 1252 }
> 1253 }
> 1254
>
next prev parent reply other threads:[~2025-06-22 14:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 17:33 [PATCH v6 00/12] iio: adc: Add support for AD4170 series of ADCs Marcelo Schmitt
2025-06-18 17:34 ` [PATCH v6 01/12] dt-bindings: iio: adc: Add AD4170 Marcelo Schmitt
2025-06-19 15:35 ` Conor Dooley
2025-06-22 13:44 ` Jonathan Cameron
2025-06-18 17:35 ` [PATCH v6 02/12] iio: adc: Add basic support for AD4170 Marcelo Schmitt
2025-06-22 14:08 ` Jonathan Cameron
2025-06-18 17:36 ` [PATCH v6 03/12] iio: adc: ad4170: Add support for calibration gain Marcelo Schmitt
2025-06-18 17:36 ` [PATCH v6 04/12] iio: adc: ad4170: Add support for calibration bias Marcelo Schmitt
2025-06-18 17:36 ` [PATCH v6 05/12] Documentation: ABI: IIO: Add sinc5+avg to the filter_type_available list Marcelo Schmitt
2025-06-22 14:09 ` Jonathan Cameron
2025-06-18 17:37 ` [PATCH v6 06/12] iio: adc: ad4170: Add digital filter and sample frequency config support Marcelo Schmitt
2025-06-20 2:38 ` kernel test robot
2025-06-22 14:12 ` Jonathan Cameron [this message]
2025-06-18 17:37 ` [PATCH v6 07/12] iio: adc: ad4170: Add support for buffered data capture Marcelo Schmitt
2025-06-22 14:18 ` Jonathan Cameron
2025-06-18 17:37 ` [PATCH v6 08/12] iio: adc: ad4170: Add clock provider support Marcelo Schmitt
2025-06-18 17:38 ` [PATCH v6 09/12] iio: adc: ad4170: Add GPIO controller support Marcelo Schmitt
2025-06-18 17:38 ` [PATCH v6 10/12] iio: adc: ad4170: Add support for internal temperature sensor Marcelo Schmitt
2025-06-18 17:38 ` [PATCH v6 11/12] iio: adc: ad4170: Add support for weigh scale and RTD sensors Marcelo Schmitt
2025-06-18 17:39 ` [PATCH v6 12/12] iio: adc: ad4170: Add timestamp channel Marcelo Schmitt
2025-06-22 14:21 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250622151229.4e56e8ae@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=marcelo.schmitt1@gmail.com \
--cc=marcelo.schmitt@analog.com \
--cc=nuno.sa@analog.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox