Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [peterz-queue:locking/test 3/3] drivers/iio/adc/ad7380.c:851:2: error: cannot jump from switch statement to this case label
@ 2024-10-24  1:01 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-24  1:01 UTC (permalink / raw)
  To: David Lechner; +Cc: llvm, oe-kbuild-all, Peter Zijlstra

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/test
head:   800b10017d81d19743a95725b73d0026e1647bc9
commit: 800b10017d81d19743a95725b73d0026e1647bc9 [3/3] iio: adc: ad7380: use if_not_guard for claim direct
config: arm-randconfig-004-20241024 (https://download.01.org/0day-ci/archive/20241024/202410240802.VMztsHsW-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 5886454669c3c9026f7f27eab13509dd0241f2d6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241024/202410240802.VMztsHsW-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/202410240802.VMztsHsW-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/iio/adc/ad7380.c:27:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/iio/adc/ad7380.c:851:2: error: cannot jump from switch statement to this case label
     851 |         default:
         |         ^
   drivers/iio/adc/ad7380.c:823:3: note: jump bypasses initialization of variable with __attribute__((cleanup))
     823 |                 if_not_guard(iio_claim_direct_try, indio_dev)
         |                 ^
   include/linux/cleanup.h:359:24: note: expanded from macro 'if_not_guard'
     359 |         __if_not_guard(_name, __UNIQUE_ID(guard), args)
         |                               ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:17:1: note: expanded from here
      17 | __UNIQUE_ID_guard334
         | ^
   drivers/iio/adc/ad7380.c:847:2: error: cannot jump from switch statement to this case label
     847 |         case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
         |         ^
   drivers/iio/adc/ad7380.c:823:3: note: jump bypasses initialization of variable with __attribute__((cleanup))
     823 |                 if_not_guard(iio_claim_direct_try, indio_dev)
         |                 ^
   include/linux/cleanup.h:359:24: note: expanded from macro 'if_not_guard'
     359 |         __if_not_guard(_name, __UNIQUE_ID(guard), args)
         |                               ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:17:1: note: expanded from here
      17 | __UNIQUE_ID_guard334
         | ^
   drivers/iio/adc/ad7380.c:838:2: error: cannot jump from switch statement to this case label
     838 |         case IIO_CHAN_INFO_OFFSET:
         |         ^
   drivers/iio/adc/ad7380.c:823:3: note: jump bypasses initialization of variable with __attribute__((cleanup))
     823 |                 if_not_guard(iio_claim_direct_try, indio_dev)
         |                 ^
   include/linux/cleanup.h:359:24: note: expanded from macro 'if_not_guard'
     359 |         __if_not_guard(_name, __UNIQUE_ID(guard), args)
         |                               ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:17:1: note: expanded from here
      17 | __UNIQUE_ID_guard334
         | ^
   drivers/iio/adc/ad7380.c:827:2: error: cannot jump from switch statement to this case label
     827 |         case IIO_CHAN_INFO_SCALE:
         |         ^
   drivers/iio/adc/ad7380.c:823:3: note: jump bypasses initialization of variable with __attribute__((cleanup))
     823 |                 if_not_guard(iio_claim_direct_try, indio_dev)
         |                 ^
   include/linux/cleanup.h:359:24: note: expanded from macro 'if_not_guard'
     359 |         __if_not_guard(_name, __UNIQUE_ID(guard), args)
         |                               ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:17:1: note: expanded from here
      17 | __UNIQUE_ID_guard334
         | ^
   drivers/iio/adc/ad7380.c:935:2: error: cannot jump from switch statement to this case label
     935 |         default:
         |         ^
   drivers/iio/adc/ad7380.c:911:3: note: jump bypasses initialization of variable with __attribute__((cleanup))
     911 |                 if_not_guard(iio_claim_direct_try, indio_dev)
         |                 ^
   include/linux/cleanup.h:359:24: note: expanded from macro 'if_not_guard'
     359 |         __if_not_guard(_name, __UNIQUE_ID(guard), args)
         |                               ^
   include/linux/compiler.h:189:29: note: expanded from macro '__UNIQUE_ID'
     189 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b


vim +851 drivers/iio/adc/ad7380.c

b095217c104bca David Lechner  2024-05-28  808  
b095217c104bca David Lechner  2024-05-28  809  static int ad7380_read_raw(struct iio_dev *indio_dev,
b095217c104bca David Lechner  2024-05-28  810  			   struct iio_chan_spec const *chan,
b095217c104bca David Lechner  2024-05-28  811  			   int *val, int *val2, long info)
b095217c104bca David Lechner  2024-05-28  812  {
b095217c104bca David Lechner  2024-05-28  813  	struct ad7380_state *st = iio_priv(indio_dev);
15b08012852f40 Julien Stephan 2024-05-30  814  	const struct iio_scan_type *scan_type;
15b08012852f40 Julien Stephan 2024-05-30  815  
15b08012852f40 Julien Stephan 2024-05-30  816  	scan_type = iio_get_current_scan_type(indio_dev, chan);
15b08012852f40 Julien Stephan 2024-05-30  817  
15b08012852f40 Julien Stephan 2024-05-30  818  	if (IS_ERR(scan_type))
15b08012852f40 Julien Stephan 2024-05-30  819  		return PTR_ERR(scan_type);
b095217c104bca David Lechner  2024-05-28  820  
b095217c104bca David Lechner  2024-05-28  821  	switch (info) {
b095217c104bca David Lechner  2024-05-28  822  	case IIO_CHAN_INFO_RAW:
800b10017d81d1 David Lechner  2024-10-01  823  		if_not_guard(iio_claim_direct_try, indio_dev)
800b10017d81d1 David Lechner  2024-10-01  824  			return -EBUSY;
800b10017d81d1 David Lechner  2024-10-01  825  
800b10017d81d1 David Lechner  2024-10-01  826  		return ad7380_read_direct(st, chan->scan_index, scan_type, val);
b095217c104bca David Lechner  2024-05-28  827  	case IIO_CHAN_INFO_SCALE:
b095217c104bca David Lechner  2024-05-28  828  		/*
2920b6ee6d69ed David Lechner  2024-05-28  829  		 * According to the datasheet, the LSB size is:
2920b6ee6d69ed David Lechner  2024-05-28  830  		 *    * (2 × VREF) / 2^N, for differential chips
2920b6ee6d69ed David Lechner  2024-05-28  831  		 *    * VREF / 2^N, for pseudo-differential chips
2920b6ee6d69ed David Lechner  2024-05-28  832  		 * where N is the ADC resolution (i.e realbits)
b095217c104bca David Lechner  2024-05-28  833  		 */
b095217c104bca David Lechner  2024-05-28  834  		*val = st->vref_mv;
15b08012852f40 Julien Stephan 2024-05-30  835  		*val2 = scan_type->realbits - chan->differential;
b095217c104bca David Lechner  2024-05-28  836  
b095217c104bca David Lechner  2024-05-28  837  		return IIO_VAL_FRACTIONAL_LOG2;
2920b6ee6d69ed David Lechner  2024-05-28  838  	case IIO_CHAN_INFO_OFFSET:
2920b6ee6d69ed David Lechner  2024-05-28  839  		/*
2920b6ee6d69ed David Lechner  2024-05-28  840  		 * According to IIO ABI, offset is applied before scale,
2920b6ee6d69ed David Lechner  2024-05-28  841  		 * so offset is: vcm_mv / scale
2920b6ee6d69ed David Lechner  2024-05-28  842  		 */
15b08012852f40 Julien Stephan 2024-05-30  843  		*val = st->vcm_mv[chan->channel] * (1 << scan_type->realbits)
2920b6ee6d69ed David Lechner  2024-05-28  844  			/ st->vref_mv;
2920b6ee6d69ed David Lechner  2024-05-28  845  
15b08012852f40 Julien Stephan 2024-05-30  846  		return IIO_VAL_INT;
15b08012852f40 Julien Stephan 2024-05-30  847  	case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
15b08012852f40 Julien Stephan 2024-05-30  848  		*val = st->oversampling_ratio;
15b08012852f40 Julien Stephan 2024-05-30  849  
2920b6ee6d69ed David Lechner  2024-05-28  850  		return IIO_VAL_INT;
b095217c104bca David Lechner  2024-05-28 @851  	default:
b095217c104bca David Lechner  2024-05-28  852  		return -EINVAL;
b095217c104bca David Lechner  2024-05-28  853  	}
b095217c104bca David Lechner  2024-05-28  854  }
b095217c104bca David Lechner  2024-05-28  855  

:::::: The code at line 851 was first introduced by commit
:::::: b095217c104bca87d5e24c147b3e37cae921c441 iio: adc: ad7380: new driver for AD7380 ADCs

:::::: TO: David Lechner <dlechner@baylibre.com>
:::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-24  1:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-24  1:01 [peterz-queue:locking/test 3/3] drivers/iio/adc/ad7380.c:851:2: error: cannot jump from switch statement to this case label kernel test robot

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