CC: [email protected]
CC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: Antoniu Miclaus <[email protected]>
CC: Jonathan Cameron <[email protected]>
CC: Cai Huoqing <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   c122052c3cb861b3e61a01d2c2ab9069e470663e
commit: 0bb12606c05fe9737e3056fe76d6e4b9c2a87b57 [4367/8462] iio:dac:ad7293: 
add support for AD7293
:::::: branch date: 14 hours ago
:::::: commit date: 13 days ago
config: riscv-randconfig-c006-20211214 
(https://download.01.org/0day-ci/archive/20211218/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
b6a2ddb6c8ac29412b1361810972e15221fa021c)
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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=0bb12606c05fe9737e3056fe76d6e4b9c2a87b57
        git remote add linux-next 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 0bb12606c05fe9737e3056fe76d6e4b9c2a87b57
        # save the config file 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 <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
   drivers/iio/industrialio-buffer.c:895:2: note: Loop condition is true.  
Entering loop body
           list_for_each_entry(buffer, &iio_dev_opaque->buffer_list, 
buffer_list) {
           ^
   include/linux/list.h:630:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   drivers/iio/industrialio-buffer.c:896:7: note: Assuming 'buffer' is equal to 
'remove_buffer'
                   if (buffer == remove_buffer)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/industrialio-buffer.c:896:7: note: Assuming pointer value is null
                   if (buffer == remove_buffer)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/industrialio-buffer.c:896:3: note: Taking true branch
                   if (buffer == remove_buffer)
                   ^
   drivers/iio/industrialio-buffer.c:897:4: note:  Execution continues on line 
895
                           continue;
                           ^
   drivers/iio/industrialio-buffer.c:895:2: note: Dereference of null pointer
           list_for_each_entry(buffer, &iio_dev_opaque->buffer_list, 
buffer_list) {
           ^
   include/linux/list.h:632:13: note: expanded from macro 'list_for_each_entry'
                pos = list_next_entry(pos, member))
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/list.h:557:2: note: expanded from macro 'list_next_entry'
           list_entry((pos)->member.next, typeof(*(pos)), member)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/list.h:513:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/container_of.h:18:25: note: expanded from macro 'container_of'
           void *__mptr = (void *)(ptr);                                   \
                                  ^~~~~
   Suppressed 2 warnings (2 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   5 warnings generated.
   drivers/iio/dac/ad5064.c:105:8: warning: Excessive padding in 'struct 
ad5064_state' (75 padding bytes, where 11 is optimal). 
   Optimal fields order: 
   data, 
   dac_cache, 
   use_internal_vref, 
   pwr_down, 
   pwr_down_mode, 
   dev, 
   chip_info, 
   write, 
   vref_reg, 
   lock, 
   consider reordering the fields or adding explicit padding members 
[clang-analyzer-optin.performance.Padding]
   struct ad5064_state {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/iio/dac/ad5064.c:105:8: note: Excessive padding in 'struct 
ad5064_state' (75 padding bytes, where 11 is optimal). Optimal fields order: 
data, dac_cache, use_internal_vref, pwr_down, pwr_down_mode, dev, chip_info, 
write, vref_reg, lock, consider reordering the fields or adding explicit 
padding members
   struct ad5064_state {
   ~~~~~~~^~~~~~~~~~~~~~
   Suppressed 4 warnings (4 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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   5 warnings generated.
   drivers/iio/dac/ad5764.c:52:8: warning: Excessive padding in 'struct 
ad5764_state' (112 padding bytes, where 48 is optimal). 
   Optimal fields order: 
   data, 
   spi, 
   chip_info, 
   vref_reg, 
   lock, 
   consider reordering the fields or adding explicit padding members 
[clang-analyzer-optin.performance.Padding]
   struct ad5764_state {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/iio/dac/ad5764.c:52:8: note: Excessive padding in 'struct 
ad5764_state' (112 padding bytes, where 48 is optimal). Optimal fields order: 
data, spi, chip_info, vref_reg, lock, consider reordering the fields or adding 
explicit padding members
   struct ad5764_state {
   ~~~~~~~^~~~~~~~~~~~~~
   Suppressed 4 warnings (4 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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   6 warnings generated.
>> drivers/iio/dac/ad7293.c:139:8: warning: Excessive padding in 'struct 
>> ad7293_state' (84 padding bytes, where 20 is optimal). 
   Optimal fields order: 
   data, 
   page_select, 
   spi, 
   gpio_reset, 
   reg_avdd, 
   reg_vdrive, 
   lock, 
   consider reordering the fields or adding explicit padding members 
[clang-analyzer-optin.performance.Padding]
   struct ad7293_state {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/iio/dac/ad7293.c:139:8: note: Excessive padding in 'struct 
ad7293_state' (84 padding bytes, where 20 is optimal). Optimal fields order: 
data, page_select, spi, gpio_reset, reg_avdd, reg_vdrive, lock, consider 
reordering the fields or adding explicit padding members
   struct ad7293_state {
   ~~~~~~~^~~~~~~~~~~~~~
>> drivers/iio/dac/ad7293.c:647:13: warning: Assigned value is garbage or 
>> undefined [clang-analyzer-core.uninitialized.Assign]
                   *read_val = temp;
                             ^ ~~~~
   drivers/iio/dac/ad7293.c:644:6: note: Assuming 'read_val' is non-null
           if (read_val) {
               ^~~~~~~~
   drivers/iio/dac/ad7293.c:644:2: note: Taking true branch
           if (read_val) {
           ^
   drivers/iio/dac/ad7293.c:645:3: note: 'temp' declared without an initial 
value
                   u16 temp;
                   ^~~~~~~~
   drivers/iio/dac/ad7293.c:646:9: note: Calling 'ad7293_spi_read'
                   ret = ad7293_spi_read(st, reg, &temp);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad7293.c:207:8: note: Calling '__ad7293_spi_read'
           ret = __ad7293_spi_read(st, reg, val);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad7293.c:175:11: note: Taking false branch
           length = FIELD_GET(AD7293_TRANSF_LEN_MSK, reg);
                    ^
   include/linux/bitfield.h:108:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:46:3: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),          \
                   ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:335:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:315:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/iio/dac/ad7293.c:175:11: note: Loop condition is false.  Exiting loop
           length = FIELD_GET(AD7293_TRANSF_LEN_MSK, reg);
                    ^
   include/linux/bitfield.h:108:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:46:3: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),          \
                   ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:335:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   drivers/iio/dac/ad7293.c:175:11: note: Taking false branch
           length = FIELD_GET(AD7293_TRANSF_LEN_MSK, reg);
                    ^
   include/linux/bitfield.h:108:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:48:3: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero");    \
                   ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:335:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:315:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/iio/dac/ad7293.c:175:11: note: Loop condition is false.  Exiting loop
           length = FIELD_GET(AD7293_TRANSF_LEN_MSK, reg);
                    ^
   include/linux/bitfield.h:108:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:48:3: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero");    \
                   ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:335:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \

vim +139 drivers/iio/dac/ad7293.c

0bb12606c05fe9 Antoniu Miclaus 2021-12-02  138  
0bb12606c05fe9 Antoniu Miclaus 2021-12-02 @139  struct ad7293_state {
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  140          struct spi_device *spi;
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  141          /* Protect against 
concurrent accesses to the device, page selection and data content */
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  142          struct mutex lock;
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  143          struct gpio_desc 
*gpio_reset;
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  144          struct regulator 
*reg_avdd;
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  145          struct regulator 
*reg_vdrive;
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  146          u8 page_select;
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  147          u8 data[3] 
____cacheline_aligned;
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  148  };
0bb12606c05fe9 Antoniu Miclaus 2021-12-02  149  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to