Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH v2 2/3] iio: adc: sophgo-saradc: Add driver for Sophgo SARADC
       [not found] <20240705-sg2002-adc-v2-2-83428c20a9b2@bootlin.com>
@ 2024-07-06  5:16 ` kernel test robot
  2024-07-06 10:58   ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-07-06  5:16 UTC (permalink / raw)
  To: Thomas Bonnefille, Jonathan Cameron, Lars-Peter Clausen,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen Wang,
	Inochi Amaoto, Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: llvm, oe-kbuild-all, Thomas Petazzoni, Miquèl Raynal,
	linux-iio, devicetree, linux-kernel, linux-riscv,
	Thomas Bonnefille

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on d20f6b3d747c36889b7ce75ee369182af3decb6b]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Bonnefille/dt-bindings-iio-adc-sophgo-cv18xx-saradc-yaml-Add-Sophgo-SARADC-binding-documentation/20240706-040736
base:   d20f6b3d747c36889b7ce75ee369182af3decb6b
patch link:    https://lore.kernel.org/r/20240705-sg2002-adc-v2-2-83428c20a9b2%40bootlin.com
patch subject: [PATCH v2 2/3] iio: adc: sophgo-saradc: Add driver for Sophgo SARADC
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240706/202407061311.ZEmwMY8m-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240706/202407061311.ZEmwMY8m-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/202407061311.ZEmwMY8m-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/iio/adc/sophgo-cv18xx-adc.c:85:3: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
      85 |                 struct cv18xx_adc *saradc = iio_priv(indio_dev);
         |                 ^
   1 warning generated.


vim +85 drivers/iio/adc/sophgo-cv18xx-adc.c

    78	
    79	static int cv18xx_adc_read_raw(struct iio_dev *indio_dev,
    80					  struct iio_chan_spec const *chan,
    81					  int *val, int *val2, long mask)
    82	{
    83		switch (mask) {
    84		case IIO_CHAN_INFO_RAW:
  > 85			struct cv18xx_adc *saradc = iio_priv(indio_dev);
    86			u32 sample;
    87			int ret;
    88	
    89			scoped_guard(mutex, &saradc->lock) {
    90				cv18xx_adc_start_measurement(saradc, chan->scan_index);
    91				ret = cv18xx_adc_wait(saradc);
    92				if (ret < 0)
    93					return ret;
    94	
    95				sample = readl(saradc->regs + CV18XX_ADC_CH_RESULT_REG(chan->scan_index));
    96			}
    97			if (!(sample & CV18XX_ADC_CH_VALID))
    98				return -ENODATA;
    99	
   100			*val = sample & CV18XX_ADC_CH_RESULT;
   101			return IIO_VAL_INT;
   102		case IIO_CHAN_INFO_SCALE:
   103			*val = 3300;
   104			*val2 = 12;
   105			return IIO_VAL_FRACTIONAL_LOG2;
   106		default:
   107			return -EINVAL;
   108		}
   109	}
   110	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 2/3] iio: adc: sophgo-saradc: Add driver for Sophgo SARADC
  2024-07-06  5:16 ` [PATCH v2 2/3] iio: adc: sophgo-saradc: Add driver for Sophgo SARADC kernel test robot
@ 2024-07-06 10:58   ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2024-07-06 10:58 UTC (permalink / raw)
  To: kernel test robot
  Cc: Thomas Bonnefille, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Chen Wang, Inochi Amaoto,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, llvm, oe-kbuild-all,
	Thomas Petazzoni, Miquèl Raynal, linux-iio, devicetree,
	linux-kernel, linux-riscv

On Sat, 6 Jul 2024 13:16:36 +0800
kernel test robot <lkp@intel.com> wrote:

> Hi Thomas,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on d20f6b3d747c36889b7ce75ee369182af3decb6b]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Bonnefille/dt-bindings-iio-adc-sophgo-cv18xx-saradc-yaml-Add-Sophgo-SARADC-binding-documentation/20240706-040736
> base:   d20f6b3d747c36889b7ce75ee369182af3decb6b
> patch link:    https://lore.kernel.org/r/20240705-sg2002-adc-v2-2-83428c20a9b2%40bootlin.com
> patch subject: [PATCH v2 2/3] iio: adc: sophgo-saradc: Add driver for Sophgo SARADC
> config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240706/202407061311.ZEmwMY8m-lkp@intel.com/config)
> compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240706/202407061311.ZEmwMY8m-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/202407061311.ZEmwMY8m-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> drivers/iio/adc/sophgo-cv18xx-adc.c:85:3: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]  
>       85 |                 struct cv18xx_adc *saradc = iio_priv(indio_dev);
>          |                 ^
>    1 warning generated.
> 
> 
> vim +85 drivers/iio/adc/sophgo-cv18xx-adc.c
> 
>     78	
>     79	static int cv18xx_adc_read_raw(struct iio_dev *indio_dev,
>     80					  struct iio_chan_spec const *chan,
>     81					  int *val, int *val2, long mask)
>     82	{
>     83		switch (mask) {
>     84		case IIO_CHAN_INFO_RAW:

I guess you figured this out but if not.. Key is you need to define a scope so
			{
>   > 85			struct cv18xx_adc *saradc = iio_priv(indio_dev);  
>     86			u32 sample;
>     87			int ret;
>     88	
>     89			scoped_guard(mutex, &saradc->lock) {
>     90				cv18xx_adc_start_measurement(saradc, chan->scan_index);
>     91				ret = cv18xx_adc_wait(saradc);
>     92				if (ret < 0)
>     93					return ret;
>     94	
>     95				sample = readl(saradc->regs + CV18XX_ADC_CH_RESULT_REG(chan->scan_index));
>     96			}
>     97			if (!(sample & CV18XX_ADC_CH_VALID))
>     98				return -ENODATA;
>     99	
>    100			*val = sample & CV18XX_ADC_CH_RESULT;
>    101			return IIO_VAL_INT;

			}

>    102		case IIO_CHAN_INFO_SCALE:
>    103			*val = 3300;
>    104			*val2 = 12;
>    105			return IIO_VAL_FRACTIONAL_LOG2;
>    106		default:
>    107			return -EINVAL;
>    108		}
>    109	}
>    110	
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-06 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240705-sg2002-adc-v2-2-83428c20a9b2@bootlin.com>
2024-07-06  5:16 ` [PATCH v2 2/3] iio: adc: sophgo-saradc: Add driver for Sophgo SARADC kernel test robot
2024-07-06 10:58   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox