drivers/iio/adc/stm32-dfsdm-adc.c:1320 __stm32_dfsdm_read_info_raw() error: uninitialized symbol 'ret'.
PATCH 90/166 drivers/iio/adc/stm32-dfsdm-adc.c:1320 __stm32_dfsdm_read_info_raw() error: uninitialized symbol 'ret'.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git sparse-friendly-direct-mode head: 2d042931355bda7a2fd9e7f81d0be99c3669af4f commit: 92540659cab57f14a1fc6615b93e4adb97b51acd [90/166] iio: adc: stm32-dfsdm: Factor out core of reading INFO_RAW config: m68k-randconfig-r071-20250204 (https://download.01.org/0day-ci/archive/20250204/[email protected]/config) compiler: m68k-linux-gcc (GCC) 14.2.0
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 <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/
smatch warnings:drivers/iio/adc/stm32-dfsdm-adc.c:1320 __stm32_dfsdm_read_info_raw() error: uninitialized symbol 'ret'.
vim +/ret +1320 drivers/iio/adc/stm32-dfsdm-adc.c
92540659cab57f Jonathan Cameron 2025-01-19 1309 static int __stm32_dfsdm_read_info_raw(struct iio_dev *indio_dev,
92540659cab57f Jonathan Cameron 2025-01-19 1310 struct iio_chan_spec const *chan,
92540659cab57f Jonathan Cameron 2025-01-19 1311 int *val)
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1312 {
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1313 struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1314 int ret;
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1315
3208fa0cd91914 Olivier Moysan 2024-07-30 1316 if (adc->hwc)
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1317 ret = iio_hw_consumer_enable(adc->hwc);
6fc839dc320cd6 Olivier Moysan 2024-07-30 1318 if (adc->backend)
92540659cab57f Jonathan Cameron 2025-01-19 1319 ret = iio_backend_enable(adc->backend[chan->scan_index]);Could both adc->hwc and adc->backend be false?
e2e6771c646251 Arnaud Pouliquen 2018-01-10 @1320 if (ret < 0) {
^^^Uninitialized warning
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1321 dev_err(&indio_dev->dev,
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1322 "%s: IIO enable failed (channel %d)\n",
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1323 __func__, chan->channel);
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1324 return ret;
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1325 }
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1326 ret = stm32_dfsdm_single_conv(indio_dev, chan, val);
3208fa0cd91914 Olivier Moysan 2024-07-30 1327 if (adc->hwc)
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1328 iio_hw_consumer_disable(adc->hwc);
6fc839dc320cd6 Olivier Moysan 2024-07-30 1329 if (adc->backend)
92540659cab57f Jonathan Cameron 2025-01-19 1330 iio_backend_disable(adc->backend[chan->scan_index]);
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1331 if (ret < 0) {
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1332 dev_err(&indio_dev->dev,
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1333 "%s: Conversion failed (channel %d)\n",
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1334 __func__, chan->channel);
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1335 return ret;
e2e6771c646251 Arnaud Pouliquen 2018-01-10 1336 }
92540659cab57f Jonathan Cameron 2025-01-19 1337
92540659cab57f Jonathan Cameron 2025-01-19 1338 return 0;
92540659cab57f Jonathan Cameron 2025-01-19 1339 }Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki