CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Miquel Raynal <miquel.raynal(a)bootlin.com>
CC: 0day robot <lkp(a)intel.com>
tree:
https://github.com/0day-ci/linux/commits/Miquel-Raynal/Bring-external-tri...
head: 82403933ab13283e98041a4c285420988531362c
commit: 1e80dcadd79f6dec7346dc596fbafd508ea2844e iio: adc: max1027: Minimize the number of
converted channels
date: 7 days ago
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: riscv-randconfig-c006-20210927 (attached as .config)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
#
https://github.com/0day-ci/linux/commit/1e80dcadd79f6dec7346dc596fbafd508...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Miquel-Raynal/Bring-external-triggers-support-to-MAX1027-like-ADCs/20210922-131741
git checkout 1e80dcadd79f6dec7346dc596fbafd508ea2844e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
include/linux/list.h:135:13: note: Use of memory after it is freed
__list_del(entry->prev, entry->next);
^~~~~~~~~~~
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
11 warnings generated.
drivers/iio/adc/ad7292.c:78:8: warning: Excessive padding in 'struct
ad7292_state' (114 padding bytes, where 50 is optimal).
Optimal fields order:
d16,
vref_mv,
spi,
reg,
d8,
consider reordering the fields or adding explicit padding members
[clang-analyzer-optin.performance.Padding]
struct ad7292_state {
~~~~~~~^~~~~~~~~~~~~~
drivers/iio/adc/ad7292.c:78:8: note: Excessive padding in 'struct ad7292_state'
(114 padding bytes, where 50 is optimal). Optimal fields order: d16, vref_mv, spi, reg,
d8, consider reordering the fields or adding explicit padding members
struct ad7292_state {
~~~~~~~^~~~~~~~~~~~~~
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
11 warnings generated.
drivers/iio/adc/ad7298.c:40:8: warning: Excessive padding in 'struct
ad7298_state' (72 padding bytes, where 8 is optimal).
Optimal fields order:
rx_buf,
spi,
reg,
ext_ref,
ring_msg,
scan_single_msg,
scan_single_xfer,
ring_xfer,
tx_buf,
consider reordering the fields or adding explicit padding members
[clang-analyzer-optin.performance.Padding]
struct ad7298_state {
~~~~~~~^~~~~~~~~~~~~~
drivers/iio/adc/ad7298.c:40:8: note: Excessive padding in 'struct ad7298_state'
(72 padding bytes, where 8 is optimal). Optimal fields order: rx_buf, spi, reg, ext_ref,
ring_msg, scan_single_msg, scan_single_xfer, ring_xfer, tx_buf, consider reordering the
fields or adding explicit padding members
struct ad7298_state {
~~~~~~~^~~~~~~~~~~~~~
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
11 warnings generated.
drivers/iio/adc/ad7923.c:48:8: warning: Excessive padding in 'struct
ad7923_state' (68 padding bytes, where 4 is optimal).
Optimal fields order:
rx_buf,
spi,
reg,
settings,
ring_msg,
scan_single_msg,
scan_single_xfer,
ring_xfer,
tx_buf,
consider reordering the fields or adding explicit padding members
[clang-analyzer-optin.performance.Padding]
struct ad7923_state {
~~~~~~~^~~~~~~~~~~~~~
drivers/iio/adc/ad7923.c:48:8: note: Excessive padding in 'struct ad7923_state'
(68 padding bytes, where 4 is optimal). Optimal fields order: rx_buf, spi, reg, settings,
ring_msg, scan_single_msg, scan_single_xfer, ring_xfer, tx_buf, consider reordering the
fields or adding explicit padding members
struct ad7923_state {
~~~~~~~^~~~~~~~~~~~~~
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
10 warnings generated.
drivers/gpu/drm/nouveau/nouveau_bo90b5.c:40:6: warning: Value stored to
'page_count' during its initialization is never read
[clang-analyzer-deadcode.DeadStores]
u32 page_count = new_reg->num_pages;
^~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/nouveau/nouveau_bo90b5.c:40:6: note: Value stored to
'page_count' during its initialization is never read
u32 page_count = new_reg->num_pages;
^~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
10 warnings generated.
drivers/iio/adc/max1027.c:265:8: warning: Excessive padding in 'struct
max1027_state' (99 padding bytes, where 35 is optimal).
Optimal fields order:
reg,
info,
spi,
trig,
buffer,
lock,
consider reordering the fields or adding explicit padding members
[clang-analyzer-optin.performance.Padding]
struct max1027_state {
~~~~~~~^~~~~~~~~~~~~~~
drivers/iio/adc/max1027.c:265:8: note: Excessive padding in 'struct
max1027_state' (99 padding bytes, where 35 is optimal). Optimal fields order: reg,
info, spi, trig, buffer, lock, consider reordering the fields or adding explicit padding
members
struct max1027_state {
~~~~~~~^~~~~~~~~~~~~~~
> drivers/iio/adc/max1027.c:412:14: warning: The result of the left
shift is undefined because the left operand is negative
[clang-analyzer-core.UndefinedBinaryOperatorResult]
st->reg |=
MAX1027_CHAN(fls(*indio_dev->active_scan_mask) - 2);
^
drivers/iio/adc/max1027.c:38:32: note: expanded from macro 'MAX1027_CHAN'
#define MAX1027_CHAN(n) ((n) << 3)
~~~ ^
drivers/iio/adc/max1027.c:399:6: note: Assuming 'state' is true
if (state) {
^~~~~
drivers/iio/adc/max1027.c:399:2: note: Taking true branch
if (state) {
^
drivers/iio/adc/max1027.c:404:7: note: Assuming 'ret' is >= 0
if (ret < 0)
^~~~~~~
drivers/iio/adc/max1027.c:404:3: note: Taking false branch
if (ret < 0)
^
drivers/iio/adc/max1027.c:412:14: note: The result of the left shift is undefined
because the left operand is negative
st->reg |= MAX1027_CHAN(fls(*indio_dev->active_scan_mask) - 2);
^
drivers/iio/adc/max1027.c:38:32: note: expanded from macro 'MAX1027_CHAN'
#define MAX1027_CHAN(n) ((n) << 3)
~~~ ^
Suppressed 8 warnings (8 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
11 warnings generated.
drivers/iio/adc/max11100.c:31:8: warning: Excessive padding in 'struct
max11100_state' (117 padding bytes, where 53 is optimal).
Optimal fields order:
buffer,
vref_reg,
spi,
consider reordering the fields or adding explicit padding members
[clang-analyzer-optin.performance.Padding]
struct max11100_state {
~~~~~~~^~~~~~~~~~~~~~~~
drivers/iio/adc/max11100.c:31:8: note: Excessive padding in 'struct
max11100_state' (117 padding bytes, where 53 is optimal). Optimal fields order:
buffer, vref_reg, spi, consider reordering the fields or adding explicit padding members
struct max11100_state {
~~~~~~~^~~~~~~~~~~~~~~~
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
11 warnings generated.
drivers/iio/adc/max1241.c:22:8: warning: Excessive padding in 'struct max1241'
(98 padding bytes, where 34 is optimal).
Optimal fields order:
data,
spi,
vdd,
vref,
shutdown,
lock,
consider reordering the fields or adding explicit padding members
[clang-analyzer-optin.performance.Padding]
struct max1241 {
~~~~~~~^~~~~~~~~
drivers/iio/adc/max1241.c:22:8: note: Excessive padding in 'struct max1241' (98
padding bytes, where 34 is optimal). Optimal fields order: data, spi, vdd, vref, shutdown,
lock, consider reordering the fields or adding explicit padding members
struct max1241 {
~~~~~~~^~~~~~~~~
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
18 warnings generated.
Suppressed 18 warnings (10 in non-user code, 8 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
11 warnings generated.
drivers/iio/dac/ad5770r.c:133:8: warning: Excessive padding in 'struct
ad5770r_state' (86 padding bytes, where 22 is optimal).
Optimal fields order:
transf_buf,
internal_ref,
external_res,
spi,
regmap,
vref_reg,
gpio_reset,
vref,
ch_pwr_down,
output_mode,
consider reordering the fields or adding explicit padding members
[clang-analyzer-optin.performance.Padding]
struct ad5770r_state {
~~~~~~~^~~~~~~~~~~~~~~
drivers/iio/dac/ad5770r.c:133:8: note: Excessive padding in 'struct
ad5770r_state' (86 padding bytes, where 22 is optimal). Optimal fields order:
transf_buf, internal_ref, external_res, spi, regmap, vref_reg, gpio_reset, vref,
ch_pwr_down, output_mode, consider reordering the fields or adding explicit padding
members
struct ad5770r_state {
~~~~~~~^~~~~~~~~~~~~~~
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
11 warnings generated.
drivers/iio/dac/ad7303.c:37:8: warning: Excessive padding in 'struct
ad7303_state' (98 padding bytes, where 34 is optimal).
Optimal fields order:
data,
config,
spi,
vdd_reg,
vref_reg,
vim +412 drivers/iio/adc/max1027.c
fc167f62483325 Philippe Reynes 2014-06-14 392
fc167f62483325 Philippe Reynes 2014-06-14 393 static int
max1027_set_trigger_state(struct iio_trigger *trig, bool state)
fc167f62483325 Philippe Reynes 2014-06-14 394 {
fc167f62483325 Philippe Reynes 2014-06-14 395 struct iio_dev *indio_dev =
iio_trigger_get_drvdata(trig);
fc167f62483325 Philippe Reynes 2014-06-14 396 struct max1027_state *st =
iio_priv(indio_dev);
fc167f62483325 Philippe Reynes 2014-06-14 397 int ret;
fc167f62483325 Philippe Reynes 2014-06-14 398
fc167f62483325 Philippe Reynes 2014-06-14 399 if (state) {
fc167f62483325 Philippe Reynes 2014-06-14 400 /* Start acquisition on cnvst */
fc167f62483325 Philippe Reynes 2014-06-14 401 st->reg = MAX1027_SETUP_REG |
MAX1027_CKS_MODE0 |
fc167f62483325 Philippe Reynes 2014-06-14 402 MAX1027_REF_MODE2;
fc167f62483325 Philippe Reynes 2014-06-14 403 ret = spi_write(st->spi,
&st->reg, 1);
fc167f62483325 Philippe Reynes 2014-06-14 404 if (ret < 0)
fc167f62483325 Philippe Reynes 2014-06-14 405 return ret;
fc167f62483325 Philippe Reynes 2014-06-14 406
1e80dcadd79f6d Miquel Raynal 2021-09-21 407 /*
1e80dcadd79f6d Miquel Raynal 2021-09-21 408 * Scan from chan 0 to the highest
requested channel.
1e80dcadd79f6d Miquel Raynal 2021-09-21 409 * Include temperature on demand.
1e80dcadd79f6d Miquel Raynal 2021-09-21 410 */
1e80dcadd79f6d Miquel Raynal 2021-09-21 411 st->reg = MAX1027_CONV_REG |
MAX1027_SCAN_0_N;
1e80dcadd79f6d Miquel Raynal 2021-09-21 @412 st->reg |=
MAX1027_CHAN(fls(*indio_dev->active_scan_mask) - 2);
1e80dcadd79f6d Miquel Raynal 2021-09-21 413 if (*indio_dev->active_scan_mask
& MAX1X27_SCAN_MASK_TEMP)
1e80dcadd79f6d Miquel Raynal 2021-09-21 414 st->reg |= MAX1027_TEMP;
1e80dcadd79f6d Miquel Raynal 2021-09-21 415
fc167f62483325 Philippe Reynes 2014-06-14 416 ret = spi_write(st->spi,
&st->reg, 1);
fc167f62483325 Philippe Reynes 2014-06-14 417 if (ret < 0)
fc167f62483325 Philippe Reynes 2014-06-14 418 return ret;
fc167f62483325 Philippe Reynes 2014-06-14 419 } else {
fc167f62483325 Philippe Reynes 2014-06-14 420 /* Start acquisition on conversion
register write */
fc167f62483325 Philippe Reynes 2014-06-14 421 st->reg = MAX1027_SETUP_REG |
MAX1027_CKS_MODE2 |
fc167f62483325 Philippe Reynes 2014-06-14 422 MAX1027_REF_MODE2;
fc167f62483325 Philippe Reynes 2014-06-14 423 ret = spi_write(st->spi,
&st->reg, 1);
fc167f62483325 Philippe Reynes 2014-06-14 424 if (ret < 0)
fc167f62483325 Philippe Reynes 2014-06-14 425 return ret;
fc167f62483325 Philippe Reynes 2014-06-14 426 }
fc167f62483325 Philippe Reynes 2014-06-14 427
fc167f62483325 Philippe Reynes 2014-06-14 428 return 0;
fc167f62483325 Philippe Reynes 2014-06-14 429 }
fc167f62483325 Philippe Reynes 2014-06-14 430
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org