From: kernel test robot <lkp@intel.com>
To: David Lechner <dlechner@baylibre.com>,
Peter Zijlstra <peterz@infradead.org>,
Dan Williams <dan.j.williams@intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Jonathan Cameron <jic23@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
LKML <linux-kernel@vger.kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Michael Hennerich" <michael.hennerich@analog.com>,
linux-iio@vger.kernel.org, linux-cxl@vger.kernel.org,
"David Lechner" <dlechner@baylibre.com>
Subject: Re: [PATCH 2/3] iio: adc: ad7380: use if_not_cond_guard for claim direct
Date: Thu, 3 Oct 2024 12:23:07 +0800 [thread overview]
Message-ID: <202410031215.IKHRIsat-lkp@intel.com> (raw)
In-Reply-To: <20241001-cleanup-if_not_cond_guard-v1-2-7753810b0f7a@baylibre.com>
Hi David,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 431c39f6d3edbab14f48dbf37a58ccdc0ac3be1e]
url: https://github.com/intel-lab-lkp/linux/commits/David-Lechner/cleanup-add-conditional-guard-helper/20241002-063209
base: 431c39f6d3edbab14f48dbf37a58ccdc0ac3be1e
patch link: https://lore.kernel.org/r/20241001-cleanup-if_not_cond_guard-v1-2-7753810b0f7a%40baylibre.com
patch subject: [PATCH 2/3] iio: adc: ad7380: use if_not_cond_guard for claim direct
config: x86_64-randconfig-011-20241003 (https://download.01.org/0day-ci/archive/20241003/202410031215.IKHRIsat-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241003/202410031215.IKHRIsat-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/202410031215.IKHRIsat-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/iio/adc/ad7380.c:823:3: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
823 | if_not_cond_guard(iio_claim_direct_try, indio_dev)
| ^
include/linux/cleanup.h:316:2: note: expanded from macro 'if_not_cond_guard'
316 | __if_not_cond_guard(_name, __UNIQUE_ID(guard), args)
| ^
include/linux/cleanup.h:312:2: note: expanded from macro '__if_not_cond_guard'
312 | CLASS(_name, _id)(args); \
| ^
include/linux/cleanup.h:258:2: note: expanded from macro 'CLASS'
258 | class_##_name##_t var __cleanup(class_##_name##_destructor) = \
| ^
<scratch space>:67:1: note: expanded from here
67 | class_iio_claim_direct_try_t
| ^
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_cond_guard(iio_claim_direct_try, indio_dev)
| ^
include/linux/cleanup.h:316:29: note: expanded from macro 'if_not_cond_guard'
316 | __if_not_cond_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>:65:1: note: expanded from here
65 | __UNIQUE_ID_guard837
| ^
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_cond_guard(iio_claim_direct_try, indio_dev)
| ^
include/linux/cleanup.h:316:29: note: expanded from macro 'if_not_cond_guard'
316 | __if_not_cond_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>:65:1: note: expanded from here
65 | __UNIQUE_ID_guard837
| ^
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_cond_guard(iio_claim_direct_try, indio_dev)
| ^
include/linux/cleanup.h:316:29: note: expanded from macro 'if_not_cond_guard'
316 | __if_not_cond_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>:65:1: note: expanded from here
65 | __UNIQUE_ID_guard837
| ^
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_cond_guard(iio_claim_direct_try, indio_dev)
| ^
include/linux/cleanup.h:316:29: note: expanded from macro 'if_not_cond_guard'
316 | __if_not_cond_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>:65:1: note: expanded from here
65 | __UNIQUE_ID_guard837
| ^
drivers/iio/adc/ad7380.c:935:2: error: cannot jump from switch statement to this case label
935 | default:
vim +823 drivers/iio/adc/ad7380.c
808
809 static int ad7380_read_raw(struct iio_dev *indio_dev,
810 struct iio_chan_spec const *chan,
811 int *val, int *val2, long info)
812 {
813 struct ad7380_state *st = iio_priv(indio_dev);
814 const struct iio_scan_type *scan_type;
815
816 scan_type = iio_get_current_scan_type(indio_dev, chan);
817
818 if (IS_ERR(scan_type))
819 return PTR_ERR(scan_type);
820
821 switch (info) {
822 case IIO_CHAN_INFO_RAW:
> 823 if_not_cond_guard(iio_claim_direct_try, indio_dev)
824 return -EBUSY;
825
826 return ad7380_read_direct(st, chan->scan_index, scan_type, val);
827 case IIO_CHAN_INFO_SCALE:
828 /*
829 * According to the datasheet, the LSB size is:
830 * * (2 × VREF) / 2^N, for differential chips
831 * * VREF / 2^N, for pseudo-differential chips
832 * where N is the ADC resolution (i.e realbits)
833 */
834 *val = st->vref_mv;
835 *val2 = scan_type->realbits - chan->differential;
836
837 return IIO_VAL_FRACTIONAL_LOG2;
838 case IIO_CHAN_INFO_OFFSET:
839 /*
840 * According to IIO ABI, offset is applied before scale,
841 * so offset is: vcm_mv / scale
842 */
843 *val = st->vcm_mv[chan->channel] * (1 << scan_type->realbits)
844 / st->vref_mv;
845
846 return IIO_VAL_INT;
847 case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
848 *val = st->oversampling_ratio;
849
850 return IIO_VAL_INT;
851 default:
852 return -EINVAL;
853 }
854 }
855
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-10-03 4:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 22:30 [PATCH 0/3] cleanup: add if_not_cond_guard macro David Lechner
2024-10-01 22:30 ` [PATCH 1/3] cleanup: add conditional guard helper David Lechner
2024-10-04 17:34 ` Dan Williams
2024-10-04 20:27 ` David Lechner
2024-10-18 11:15 ` Peter Zijlstra
2024-10-18 12:31 ` Przemek Kitszel
2024-10-18 16:29 ` Jonathan Cameron
2024-10-18 19:29 ` Dan Williams
2024-10-23 10:57 ` Peter Zijlstra
2024-10-26 7:35 ` [tip: locking/core] cleanup: Add " tip-bot2 for David Lechner
2024-10-01 22:30 ` [PATCH 2/3] iio: adc: ad7380: use if_not_cond_guard for claim direct David Lechner
2024-10-03 4:23 ` kernel test robot [this message]
2024-10-03 5:35 ` kernel test robot
2024-10-03 14:20 ` David Lechner
2024-10-01 22:30 ` [PATCH 3/3] cxl/region: Use cond_guard() in show_targetN() David Lechner
2024-10-02 2:13 ` [PATCH 0/3] cleanup: add if_not_cond_guard macro Dan Williams
2024-10-06 11:35 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202410031215.IKHRIsat-lkp@intel.com \
--to=lkp@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=michael.hennerich@analog.com \
--cc=nuno.sa@analog.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.