Re: [PATCH v5] iio: chemical: scd30: Replace manual locking with RAII locking

From: kernel test robot

Date: Fri May 29 2026 - 09:21:32 EST


Hi Maxwell,

kernel test robot noticed the following build errors:

[auto build test ERROR on jic23-iio/togreg]
[also build test ERROR on linus/master v7.1-rc5 next-20260528]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Maxwell-Doose/iio-chemical-scd30-Replace-manual-locking-with-RAII-locking/20260529-063551
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20260528222906.61561-1-m32285159%40gmail.com
patch subject: [PATCH v5] iio: chemical: scd30: Replace manual locking with RAII locking
config: loongarch-randconfig-r071-20260529 (https://download.01.org/0day-ci/archive/20260529/202605292101.GTdtBJA1-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 15.2.0
smatch: v0.5.0-9185-gbcc58b9c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260529/202605292101.GTdtBJA1-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/202605292101.GTdtBJA1-lkp@xxxxxxxxx/

All error/warnings (new ones prefixed by >>):

drivers/iio/chemical/scd30_core.c: In function 'scd30_trigger_handler':
>> drivers/iio/chemical/scd30_core.c:617:15: error: implicit declaration of function 'scd30_trigger_handler_helper_locked'; did you mean 'scd30_trigger_handler_helper'? [-Wimplicit-function-declaration]
617 | ret = scd30_trigger_handler_helper_locked(indio_dev, scan.data, sizeof(scan.data));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| scd30_trigger_handler_helper
drivers/iio/chemical/scd30_core.c: At top level:
>> drivers/iio/chemical/scd30_core.c:590:12: warning: 'scd30_trigger_handler_helper' defined but not used [-Wunused-function]
590 | static int scd30_trigger_handler_helper(struct iio_dev *indio_dev, int *scan_data,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +617 drivers/iio/chemical/scd30_core.c

589
> 590 static int scd30_trigger_handler_helper(struct iio_dev *indio_dev, int *scan_data,
591 size_t scan_data_size)
592 {
593 struct scd30_state *state = iio_priv(indio_dev);
594 int ret;
595
596 guard(mutex)(&state->lock);
597
598 if (!iio_trigger_using_own(indio_dev))
599 ret = scd30_read_poll(state);
600 else
601 ret = scd30_read_meas(state);
602 memcpy(scan_data, state->meas, scan_data_size);
603
604 return ret;
605 }
606
607 static irqreturn_t scd30_trigger_handler(int irq, void *p)
608 {
609 struct iio_poll_func *pf = p;
610 struct iio_dev *indio_dev = pf->indio_dev;
611 struct {
612 int data[SCD30_MEAS_COUNT];
613 aligned_s64 ts;
614 } scan = { };
615 int ret;
616
> 617 ret = scd30_trigger_handler_helper_locked(indio_dev, scan.data, sizeof(scan.data));
618 if (ret)
619 goto out;
620
621 iio_push_to_buffers_with_ts(indio_dev, &scan, sizeof(scan),
622 iio_get_time_ns(indio_dev));
623 out:
624 iio_trigger_notify_done(indio_dev->trig);
625 return IRQ_HANDLED;
626 }
627

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki