Re: [PATCH] iio: dps310.c: Remove duplication in functions

From: kernel test robot
Date: Thu Jul 03 2025 - 12:14:18 EST


Hi Lucas,

kernel test robot noticed the following build errors:

[auto build test ERROR on jic23-iio/togreg]
[also build test ERROR on linus/master v6.16-rc4 next-20250703]
[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/Lucas-Eiji-Uchiyama/iio-dps310-c-Remove-duplication-in-functions/20250703-073628
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20250702233441.94203-1-lucaseiji54%40gmail.com
patch subject: [PATCH] iio: dps310.c: Remove duplication in functions
config: arm64-randconfig-001-20250703 (https://download.01.org/0day-ci/archive/20250703/202507032329.6gxPgmu4-lkp@xxxxxxxxx/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f1a4bb62452d88a0edd9340b3ca7c9b11ad9193f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250703/202507032329.6gxPgmu4-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/202507032329.6gxPgmu4-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/iio/pressure/dps310.c:553:47: error: too few arguments to function call, expected 3, have 2
553 | rc = dps310_set_samp_freq(data, TEMPERATURE);
| ~~~~~~~~~~~~~~~~~~~~ ^
drivers/iio/pressure/dps310.c:309:12: note: 'dps310_set_samp_freq' declared here
309 | static int dps310_set_samp_freq(struct dps310_data *data, int freq, int mode)
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


vim +553 drivers/iio/pressure/dps310.c

534
535 static int dps310_write_raw(struct iio_dev *iio,
536 struct iio_chan_spec const *chan, int val,
537 int val2, long mask)
538 {
539 int rc;
540 struct dps310_data *data = iio_priv(iio);
541
542 if (mutex_lock_interruptible(&data->lock))
543 return -EINTR;
544
545 switch (mask) {
546 case IIO_CHAN_INFO_SAMP_FREQ:
547 switch (chan->type) {
548 case IIO_PRESSURE:
549 rc = dps310_set_samp_freq(data, val, PRESSURE);
550 break;
551
552 case IIO_TEMP:
> 553 rc = dps310_set_samp_freq(data, TEMPERATURE);
554 break;
555
556 default:
557 rc = -EINVAL;
558 break;
559 }
560 break;
561
562 case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
563 switch (chan->type) {
564 case IIO_PRESSURE:
565 rc = dps310_set_precision(data, val, PRESSURE);
566 break;
567
568 case IIO_TEMP:
569 rc = dps310_set_precision(data, val, TEMPERATURE);
570 break;
571
572 default:
573 rc = -EINVAL;
574 break;
575 }
576 break;
577
578 default:
579 rc = -EINVAL;
580 break;
581 }
582
583 mutex_unlock(&data->lock);
584 return rc;
585 }
586

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