All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/iio/adc/ad7476.c:39:8: warning: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit paddi...
@ 2022-07-09 12:20 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-07-09 12:20 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: llvm, kbuild-all, linux-kernel, Alexandru Ardelean

Hi Jonathan,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e5524c2a1fc4002a52e16236659e779767617a4f
commit: 396f7234856956eb29f009da6e5d846f29f87ebd iio: core: move @chrdev from struct iio_dev to struct iio_dev_opaque
date:   1 year, 2 months ago
config: arm-randconfig-c002-20220702 (https://download.01.org/0day-ci/archive/20220709/202207092005.Rutj9g0E-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f7a80c3d08d4821e621fc88d6a2e435291f82dff)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=396f7234856956eb29f009da6e5d846f29f87ebd
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 396f7234856956eb29f009da6e5d846f29f87ebd
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer 

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
                          ^~~~~~~~~~~~~~~~
   net/core/filter.c:2813:3: note: Loop condition is false. Execution continues on line 2827
                   while (i != msg->sg.end) {
                   ^
   net/core/filter.c:2829:2: note: Calling '__clear_bit'
           __clear_bit(new, &msg->sg.copy);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/non-atomic.h:26:23: note: The result of the left shift is undefined because the right operand is negative
           unsigned long mask = BIT_MASK(nr);
                                ^
   include/linux/bits.h:10:30: note: expanded from macro 'BIT_MASK'
   #define BIT_MASK(nr)            (UL(1) << ((nr) % BITS_PER_LONG))
                                          ^  ~~~~~~~~~~~~~~~~~~~~~~
   net/core/filter.c:1736:2: warning: Null pointer passed as 1st argument to memory set function [clang-analyzer-unix.cstring.NullArg]
           memset(to, 0, len);
           ^      ~~
   net/core/filter.c:1725:15: note: Assuming 'offset' is <= 65535
           if (unlikely(offset > 0xffff))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1725:2: note: Taking false branch
           if (unlikely(offset > 0xffff))
           ^
   net/core/filter.c:1729:15: note: Assuming 'ptr' is null
           if (unlikely(!ptr))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1729:2: note: Taking true branch
           if (unlikely(!ptr))
           ^
   net/core/filter.c:1730:3: note: Control jumps to line 1736
                   goto err_clear;
                   ^
   net/core/filter.c:1736:2: note: Null pointer passed as 1st argument to memory set function
           memset(to, 0, len);
           ^      ~~
   net/core/filter.c:1770:2: warning: Null pointer passed as 1st argument to memory set function [clang-analyzer-unix.cstring.NullArg]
           memset(to, 0, len);
           ^      ~~
   net/core/filter.c:1756:15: note: Assuming 'offset' is <= 65535
           if (unlikely(offset > 0xffff))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1756:2: note: Taking false branch
           if (unlikely(offset > 0xffff))
           ^
   net/core/filter.c:1759:15: note: Assuming field 'skb' is non-null
           if (unlikely(!ctx->skb))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1759:2: note: Taking false branch
           if (unlikely(!ctx->skb))
           ^
   net/core/filter.c:1763:15: note: Assuming 'ptr' is null
           if (unlikely(!ptr))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/filter.c:1763:2: note: Taking true branch
           if (unlikely(!ptr))
           ^
   net/core/filter.c:1764:3: note: Control jumps to line 1770
                   goto err_clear;
                   ^
   net/core/filter.c:1770:2: note: Null pointer passed as 1st argument to memory set function
           memset(to, 0, len);
           ^      ~~
   net/core/filter.c:5136:15: warning: Value stored to 'sk' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct sock *sk = bpf_sock->sk;
                        ^~   ~~~~~~~~~~~~
   net/core/filter.c:5136:15: note: Value stored to 'sk' during its initialization is never read
           struct sock *sk = bpf_sock->sk;
                        ^~   ~~~~~~~~~~~~
   net/core/filter.c:5137:6: warning: Value stored to 'val' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           int val = argval & BPF_SOCK_OPS_ALL_CB_FLAGS;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/filter.c:5137:6: note: Value stored to 'val' during its initialization is never read
           int val = argval & BPF_SOCK_OPS_ALL_CB_FLAGS;
               ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 17 warnings (17 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.
   17 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 16 warnings (16 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.
   17 warnings generated.
>> drivers/iio/adc/ad7476.c:39:8: warning: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct ad7476_state {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/iio/adc/ad7476.c:39:8: note: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit padding members
   struct ad7476_state {
   ~~~~~~~^~~~~~~~~~~~~~
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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 (18 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.
   17 warnings generated.
   net/netlink/genetlink.c:1471:24: warning: Access to field 'genl_sock' results in a dereference of a null pointer (loaded from variable 'prev') [clang-analyzer-core.NullDereference]
           err = nlmsg_multicast(prev->genl_sock, skb, portid, group, flags);
                                 ^
   net/netlink/genetlink.c:1429:8: note: Calling 'genl_register_family'
           err = genl_register_family(&genl_ctrl);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/netlink/genetlink.c:398:6: note: 'err' is 0
           if (err)
               ^~~
   net/netlink/genetlink.c:398:2: note: Taking false branch
           if (err)
           ^
   net/netlink/genetlink.c:403:6: note: Assuming the condition is false
           if (genl_family_find_byname(family->name)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/netlink/genetlink.c:403:2: note: Taking false branch
           if (genl_family_find_byname(family->name)) {
           ^
   net/netlink/genetlink.c:415:2: note: Taking true branch
           if (family == &genl_ctrl) {
           ^
   net/netlink/genetlink.c:426:6: note: Assuming field 'id' is >= 0
           if (family->id < 0) {
               ^~~~~~~~~~~~~~
   net/netlink/genetlink.c:426:2: note: Taking false branch
           if (family->id < 0) {
           ^
   net/netlink/genetlink.c:432:6: note: Assuming 'err' is 0
           if (err)
               ^~~
   net/netlink/genetlink.c:432:2: note: Taking false branch
           if (err)
           ^
   net/netlink/genetlink.c:438:2: note: Calling 'genl_ctrl_event'
           genl_ctrl_event(CTRL_CMD_NEWFAMILY, family, NULL, 0);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/netlink/genetlink.c:1079:6: note: Assuming field 'genl_sock' is non-null
           if (!init_net.genl_sock)
               ^~~~~~~~~~~~~~~~~~~
   net/netlink/genetlink.c:1079:2: note: Taking false branch
           if (!init_net.genl_sock)
           ^
   net/netlink/genetlink.c:1082:2: note: Control jumps to 'case CTRL_CMD_NEWFAMILY:'  at line 1083
           switch (event) {
           ^
   net/netlink/genetlink.c:1085:3: note: Taking false branch
                   WARN_ON(grp);
                   ^
   include/asm-generic/bug.h:120:2: note: expanded from macro 'WARN_ON'
           if (unlikely(__ret_warn_on))                                    \
           ^
   net/netlink/genetlink.c:1087:3: note:  Execution continues on line 1097
                   break;
                   ^
   net/netlink/genetlink.c:1097:2: note: Taking false branch
           if (IS_ERR(msg))
           ^
   net/netlink/genetlink.c:1100:6: note: Assuming field 'netnsok' is not equal to 0
           if (!family->netnsok) {
               ^~~~~~~~~~~~~~~~
   net/netlink/genetlink.c:1100:2: note: Taking false branch
           if (!family->netnsok) {
           ^
   net/netlink/genetlink.c:1105:3: note: Calling 'genlmsg_multicast_allns'
                   genlmsg_multicast_allns(&genl_ctrl, msg, 0,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/netlink/genetlink.c:1486:19: note: Assuming 'group' is < field 'n_mcgrps'
           if (WARN_ON_ONCE(group >= family->n_mcgrps))
                            ^
   include/asm-generic/bug.h:145:27: note: expanded from macro 'WARN_ON_ONCE'
           int __ret_warn_once = !!(condition);                    \
                                    ^~~~~~~~~
   net/netlink/genetlink.c:1486:6: note: '__ret_warn_once' is 0
           if (WARN_ON_ONCE(group >= family->n_mcgrps))
               ^
   include/asm-generic/bug.h:147:15: note: expanded from macro 'WARN_ON_ONCE'
           if (unlikely(__ret_warn_once && !__warned)) {           \
                        ^~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/netlink/genetlink.c:1486:6: note: Left side of '&&' is false
           if (WARN_ON_ONCE(group >= family->n_mcgrps))
--
               ^~~~~~~~
   net/core/dev.c:6121:2: note: Taking true branch
           if (grow > 0)
           ^
   net/core/dev.c:6122:3: note: Calling 'gro_pull_from_frag0'
                   gro_pull_from_frag0(skb, grow);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/dev.c:5992:9: note: Assuming the condition is false
           BUG_ON(skb->end - skb->tail < grow);
                  ^
   include/asm-generic/bug.h:63:45: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                               ^~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/dev.c:5992:2: note: Taking false branch
           BUG_ON(skb->end - skb->tail < grow);
           ^
   include/asm-generic/bug.h:63:32: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                  ^
   net/core/dev.c:5992:2: note: Loop condition is false.  Exiting loop
           BUG_ON(skb->end - skb->tail < grow);
           ^
   include/asm-generic/bug.h:63:27: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                             ^
   net/core/dev.c:5994:2: note: Null pointer passed as 2nd argument to memory copy function
           memcpy(skb_tail_pointer(skb), NAPI_GRO_CB(skb)->frag0, grow);
           ^
   net/core/dev.c:7751:19: warning: Access to field 'lower_level' results in a dereference of a null pointer (loaded from variable 'dev') [clang-analyzer-core.NullDereference]
           dev->lower_level = __netdev_lower_depth(dev) + 1;
                            ^
   net/core/dev.c:8210:33: note: Passing value via 2nd parameter 'upper_dev'
           __netdev_upper_dev_unlink(dev, upper_dev, &priv);
                                          ^~~~~~~~~
   net/core/dev.c:8210:2: note: Calling '__netdev_upper_dev_unlink'
           __netdev_upper_dev_unlink(dev, upper_dev, &priv);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/dev.c:8174:2: note: Assuming the condition is false
           ASSERT_RTNL();
           ^
   include/linux/rtnetlink.h:110:12: note: expanded from macro 'ASSERT_RTNL'
           WARN_ONCE(!rtnl_is_locked(), \
                     ^~~~~~~~~~~~~~~~~
   include/asm-generic/bug.h:157:27: note: expanded from macro 'WARN_ONCE'
           int __ret_warn_once = !!(condition);                    \
                                    ^~~~~~~~~
   net/core/dev.c:8174:2: note: '__ret_warn_once' is 0
           ASSERT_RTNL();
           ^
   include/linux/rtnetlink.h:110:2: note: expanded from macro 'ASSERT_RTNL'
           WARN_ONCE(!rtnl_is_locked(), \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/bug.h:159:15: note: expanded from macro 'WARN_ONCE'
           if (unlikely(__ret_warn_once && !__warned)) {           \
                        ^~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/core/dev.c:8174:2: note: Left side of '&&' is false
           ASSERT_RTNL();
           ^
   include/linux/rtnetlink.h:110:2: note: expanded from macro 'ASSERT_RTNL'
           WARN_ONCE(!rtnl_is_locked(), \
           ^
   include/asm-generic/bug.h:159:31: note: expanded from macro 'WARN_ONCE'
           if (unlikely(__ret_warn_once && !__warned)) {           \
                                        ^
   net/core/dev.c:8174:2: note: Taking false branch
           ASSERT_RTNL();
           ^
   include/linux/rtnetlink.h:110:2: note: expanded from macro 'ASSERT_RTNL'
           WARN_ONCE(!rtnl_is_locked(), \
           ^
   include/asm-generic/bug.h:159:2: note: expanded from macro 'WARN_ONCE'
           if (unlikely(__ret_warn_once && !__warned)) {           \
           ^
   net/core/dev.c:8176:28: note: Assuming pointer value is null
           changeupper_info.master = netdev_master_upper_dev_get(dev) == upper_dev;
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/dev.c:8189:30: note: Passing null pointer value via 1st parameter 'dev'
           __netdev_update_lower_level(upper_dev, priv);
                                       ^~~~~~~~~
   net/core/dev.c:8189:2: note: Calling '__netdev_update_lower_level'
           __netdev_update_lower_level(upper_dev, priv);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/dev.c:7751:19: note: Access to field 'lower_level' results in a dereference of a null pointer (loaded from variable 'dev')
           dev->lower_level = __netdev_lower_depth(dev) + 1;
           ~~~              ^
   net/core/dev.c:10820:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(dev->name, name);
           ^~~~~~
   net/core/dev.c:10820:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(dev->name, name);
           ^~~~~~
   Suppressed 18 warnings (16 in non-user code, 2 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.
   17 warnings generated.
>> drivers/iio/adc/ad7476.c:39:8: warning: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct ad7476_state {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/iio/adc/ad7476.c:39:8: note: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit padding members
   struct ad7476_state {
   ~~~~~~~^~~~~~~~~~~~~~
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   net/decnet/af_decnet.c:1765:4: warning: Value stored to 'rv' is never read [clang-analyzer-deadcode.DeadStores]
                           rv = -EFAULT;
                           ^    ~~~~~~~
   net/decnet/af_decnet.c:1765:4: note: Value stored to 'rv' is never read
                           rv = -EFAULT;
                           ^    ~~~~~~~
   net/decnet/af_decnet.c:1962:2: warning: Value stored to 'mss' is never read [clang-analyzer-deadcode.DeadStores]
           mss = scp->segsize_rem;
           ^     ~~~~~~~~~~~~~~~~
   net/decnet/af_decnet.c:1962:2: note: Value stored to 'mss' is never read
           mss = scp->segsize_rem;
           ^     ~~~~~~~~~~~~~~~~
   Suppressed 16 warnings (16 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.
   17 warnings generated.
   net/decnet/dn_nsp_in.c:763:3: warning: Value stored to 'ptr' is never read [clang-analyzer-deadcode.DeadStores]
                   ptr += 2;
                   ^      ~
   net/decnet/dn_nsp_in.c:763:3: note: Value stored to 'ptr' is never read
                   ptr += 2;
                   ^      ~
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   19 warnings generated.
   net/decnet/dn_route.c:827:20: warning: Value stored to 'cb' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct dn_skb_cb *cb = DN_SKB_CB(skb);
                             ^~
   net/decnet/dn_route.c:827:20: note: Value stored to 'cb' during its initialization is never read
           struct dn_skb_cb *cb = DN_SKB_CB(skb);
                             ^~
   net/decnet/dn_route.c:839:20: warning: Value stored to 'cb' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct dn_skb_cb *cb = DN_SKB_CB(skb);
                             ^~
   net/decnet/dn_route.c:839:20: note: Value stored to 'cb' during its initialization is never read
           struct dn_skb_cb *cb = DN_SKB_CB(skb);
                             ^~
   net/decnet/dn_route.c:890:39: warning: Access to field 'mtu' results in a dereference of a null pointer (loaded from field 'dev') [clang-analyzer-core.NullDereference]
           if (dst_metric(&rt->dst, RTAX_MTU) > rt->dst.dev->mtu)
                                                ^
   net/decnet/dn_route.c:1652:2: note: Taking false branch
           if (!net_eq(net, &init_net))
           ^
   net/decnet/dn_route.c:1657:6: note: Assuming 'err' is >= 0
           if (err < 0)
               ^~~~~~~
   net/decnet/dn_route.c:1657:2: note: Taking false branch
           if (err < 0)
           ^
   net/decnet/dn_route.c:1664:6: note: Assuming 'skb' is not equal to NULL
           if (skb == NULL)
               ^~~~~~~~~~~
   net/decnet/dn_route.c:1664:2: note: Taking false branch
           if (skb == NULL)
           ^
   net/decnet/dn_route.c:1669:6: note: Assuming the condition is true
           if (tb[RTA_SRC])
               ^~~~~~~~~~~
   net/decnet/dn_route.c:1669:2: note: Taking true branch
           if (tb[RTA_SRC])
           ^
   net/decnet/dn_route.c:1672:6: note: Assuming the condition is false
           if (tb[RTA_DST])
               ^~~~~~~~~~~
   net/decnet/dn_route.c:1672:2: note: Taking false branch
           if (tb[RTA_DST])
           ^
   net/decnet/dn_route.c:1675:6: note: Assuming the condition is true
           if (tb[RTA_IIF])

vim +39 drivers/iio/adc/ad7476.c

7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  38  
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10 @39  struct ad7476_state {
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  40  	struct spi_device		*spi;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  41  	const struct ad7476_chip_info	*chip_info;
7bf50a968a1cd0 drivers/iio/adc/ad7476.c         Jonathan Cameron   2021-04-25  42  	struct regulator		*ref_reg;
af37e4703d00ce drivers/iio/adc/ad7476.c         Dragos Bogdan      2020-03-11  43  	struct gpio_desc		*convst_gpio;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  44  	struct spi_transfer		xfer;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  45  	struct spi_message		msg;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  46  	/*
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  47  	 * DMA (thus cache coherency maintenance) requires the
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  48  	 * transfer buffers to live in their own cache lines.
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  49  	 * Make the buffer large enough for one 16 bit sample and one 64 bit
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  50  	 * aligned 64 bit timestamp.
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  51  	 */
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  52  	unsigned char data[ALIGN(2, sizeof(s64)) + sizeof(s64)]
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  53  			____cacheline_aligned;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  54  };
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  55  

:::::: The code at line 39 was first introduced by commit
:::::: 7a28fe3c93d6cd920c84678a1bf45af8b4248577 staging:iio:ad7476: Squash driver into a single file.

:::::: TO: Lars-Peter Clausen <lars@metafoo.de>
:::::: CC: Jonathan Cameron <jic23@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* drivers/iio/adc/ad7476.c:39:8: warning: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit paddi...
@ 2022-07-13 23:05 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-07-13 23:05 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: llvm, kbuild-all, linux-kernel, Alexandru Ardelean

Hi Jonathan,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4a57a8400075bc5287c5c877702c68aeae2a033d
commit: 396f7234856956eb29f009da6e5d846f29f87ebd iio: core: move @chrdev from struct iio_dev to struct iio_dev_opaque
date:   1 year, 2 months ago
config: arm-randconfig-c002-20220702 (https://download.01.org/0day-ci/archive/20220714/202207140603.1fJMMFgV-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f7a80c3d08d4821e621fc88d6a2e435291f82dff)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=396f7234856956eb29f009da6e5d846f29f87ebd
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 396f7234856956eb29f009da6e5d846f29f87ebd
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer 

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
           ^
   arch/arm/include/asm/uaccess.h:393:3: note: expanded from macro '__put_user_switch'
                   switch (sizeof(*(ptr))) {                               \
                   ^
   drivers/tee/tee_core.c:584:6: note:  Execution continues on line 584
           if (put_user(arg.ret, &uarg->ret) ||
               ^
   arch/arm/include/asm/uaccess.h:406:2: note: expanded from macro 'put_user'
           __put_user_switch((x), (ptr), __pu_err, __put_user_check);      \
           ^
   arch/arm/include/asm/uaccess.h:396:47: note: expanded from macro '__put_user_switch'
                   case 4: __fn(__pu_val, __pu_ptr, __err, 4); break;      \
                                                               ^
   drivers/tee/tee_core.c:584:6: note: Loop condition is false.  Exiting loop
           if (put_user(arg.ret, &uarg->ret) ||
               ^
   arch/arm/include/asm/uaccess.h:406:2: note: expanded from macro 'put_user'
           __put_user_switch((x), (ptr), __pu_err, __put_user_check);      \
           ^
   arch/arm/include/asm/uaccess.h:387:2: note: expanded from macro '__put_user_switch'
           do {                                                            \
           ^
   drivers/tee/tee_core.c:584:6: note: Assuming the condition is false
           if (put_user(arg.ret, &uarg->ret) ||
               ^
   arch/arm/include/asm/uaccess.h:403:31: note: expanded from macro 'put_user'
   #define put_user(x, ptr)                                                \
                                                                           ^
   drivers/tee/tee_core.c:584:6: note: Left side of '||' is false
           if (put_user(arg.ret, &uarg->ret) ||
               ^
   arch/arm/include/asm/uaccess.h:403:31: note: expanded from macro 'put_user'
   #define put_user(x, ptr)                                                \
                                                                           ^
   drivers/tee/tee_core.c:585:6: note: Control jumps to 'case 4:'  at line 585
               put_user(arg.ret_origin, &uarg->ret_origin)) {
               ^
   arch/arm/include/asm/uaccess.h:406:2: note: expanded from macro 'put_user'
           __put_user_switch((x), (ptr), __pu_err, __put_user_check);      \
           ^
   arch/arm/include/asm/uaccess.h:393:3: note: expanded from macro '__put_user_switch'
                   switch (sizeof(*(ptr))) {                               \
                   ^
   drivers/tee/tee_core.c:585:6: note:  Execution continues on line 585
               put_user(arg.ret_origin, &uarg->ret_origin)) {
               ^
   arch/arm/include/asm/uaccess.h:406:2: note: expanded from macro 'put_user'
           __put_user_switch((x), (ptr), __pu_err, __put_user_check);      \
           ^
   arch/arm/include/asm/uaccess.h:396:47: note: expanded from macro '__put_user_switch'
                   case 4: __fn(__pu_val, __pu_ptr, __err, 4); break;      \
                                                               ^
   drivers/tee/tee_core.c:585:6: note: Loop condition is false.  Exiting loop
               put_user(arg.ret_origin, &uarg->ret_origin)) {
               ^
   arch/arm/include/asm/uaccess.h:406:2: note: expanded from macro 'put_user'
           __put_user_switch((x), (ptr), __pu_err, __put_user_check);      \
           ^
   arch/arm/include/asm/uaccess.h:387:2: note: expanded from macro '__put_user_switch'
           do {                                                            \
           ^
   drivers/tee/tee_core.c:585:6: note: Assuming the condition is false
               put_user(arg.ret_origin, &uarg->ret_origin)) {
               ^
   arch/arm/include/asm/uaccess.h:403:31: note: expanded from macro 'put_user'
   #define put_user(x, ptr)                                                \
                                                                           ^
   drivers/tee/tee_core.c:584:2: note: Taking false branch
           if (put_user(arg.ret, &uarg->ret) ||
           ^
   drivers/tee/tee_core.c:589:47: note: Passing null pointer value via 3rd parameter 'params'
           rc = params_to_user(uparams, arg.num_params, params);
                                                        ^~~~~~
   drivers/tee/tee_core.c:589:7: note: Calling 'params_to_user'
           rc = params_to_user(uparams, arg.num_params, params);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:439:14: note: Assuming 'n' is < 'num_params'
           for (n = 0; n < num_params; n++) {
                       ^~~~~~~~~~~~~~
   drivers/tee/tee_core.c:439:2: note: Loop condition is true.  Entering loop body
           for (n = 0; n < num_params; n++) {
           ^
   drivers/tee/tee_core.c:441:3: note: 'p' initialized to a null pointer value
                   struct tee_param *p = params + n;
                   ^~~~~~~~~~~~~~~~~~~
   drivers/tee/tee_core.c:443:11: note: Access to field 'attr' results in a dereference of a null pointer (loaded from variable 'p')
                   switch (p->attr) {
                           ^
   Suppressed 16 warnings (16 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.
   17 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 16 warnings (16 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.
   17 warnings generated.
>> drivers/iio/adc/ad7476.c:39:8: warning: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct ad7476_state {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/iio/adc/ad7476.c:39:8: note: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit padding members
   struct ad7476_state {
   ~~~~~~~^~~~~~~~~~~~~~
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   17 warnings generated.
   drivers/soundwire/stream.c:848:10: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
                           kfree(bus->defer_msg.msg->buf);
                                 ^
   drivers/soundwire/stream.c:1756:6: note: Assuming 'stream' is non-null
           if (!stream) {
               ^~~~~~~
   drivers/soundwire/stream.c:1756:2: note: Taking false branch
           if (!stream) {
           ^
   drivers/soundwire/stream.c:1763:6: note: Assuming field 'state' is equal to SDW_STREAM_ENABLED
           if (stream->state != SDW_STREAM_ENABLED) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soundwire/stream.c:1763:2: note: Taking false branch
           if (stream->state != SDW_STREAM_ENABLED) {
           ^
   drivers/soundwire/stream.c:1770:8: note: Calling '_sdw_disable_stream'
           ret = _sdw_disable_stream(stream);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soundwire/stream.c:1701:2: note: Left side of '&&' is false
           list_for_each_entry(m_rt, &stream->master_list, stream_node) {
           ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:704:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/soundwire/stream.c:1701:2: note: Taking false branch
           list_for_each_entry(m_rt, &stream->master_list, stream_node) {
           ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/soundwire/stream.c:1701:2: note: Loop condition is false.  Exiting loop
           list_for_each_entry(m_rt, &stream->master_list, stream_node) {
           ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/soundwire/stream.c:1701:2: note: Loop condition is false. Execution continues on line 1711
           list_for_each_entry(m_rt, &stream->master_list, stream_node) {
           ^
   include/linux/list.h:628:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
--
                   ^
   drivers/crypto/inside-secure/safexcel.c:651:3: note: Taking false branch
                   if (priv->flags & SAFEXCEL_HW_EIP197)
                   ^
   drivers/crypto/inside-secure/safexcel.c:664:10: note: Assuming the condition is false
                   while ((readl(EIP197_HIA_DSE_THR(priv) + EIP197_HIA_DSE_THR_STAT(pe)) &
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/inside-secure/safexcel.c:664:3: note: Loop condition is false. Execution continues on line 669
                   while ((readl(EIP197_HIA_DSE_THR(priv) + EIP197_HIA_DSE_THR_STAT(pe)) &
                   ^
   drivers/crypto/inside-secure/safexcel.c:669:7: note: Assuming field 'hwnumpes' is <= 4
                   if (priv->hwconfig.hwnumpes > 4) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/inside-secure/safexcel.c:669:3: note: Taking false branch
                   if (priv->hwconfig.hwnumpes > 4) {
                   ^
   drivers/crypto/inside-secure/safexcel.c:684:3: note: Taking false branch
                   if (priv->flags & SAFEXCEL_HW_EIP197)
                   ^
   drivers/crypto/inside-secure/safexcel.c:618:15: note: Assuming 'pe' is >= field 'pes'
           for (pe = 0; pe < priv->config.pes; pe++) {
                        ^~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/inside-secure/safexcel.c:618:2: note: Loop condition is false. Execution continues on line 712
           for (pe = 0; pe < priv->config.pes; pe++) {
           ^
   drivers/crypto/inside-secure/safexcel.c:712:14: note: Assuming 'i' is >= field 'rings'
           for (i = 0; i < priv->config.rings; i++) {
                       ^~~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/inside-secure/safexcel.c:712:2: note: Loop condition is false. Execution continues on line 738
           for (i = 0; i < priv->config.rings; i++) {
           ^
   drivers/crypto/inside-secure/safexcel.c:738:2: note: Loop condition is false. Execution continues on line 760
           for (i = 0; i < priv->config.rings; i++) {
           ^
   drivers/crypto/inside-secure/safexcel.c:760:2: note: Loop condition is true.  Entering loop body
           for (pe = 0; pe < priv->config.pes; pe++) {
           ^
   drivers/crypto/inside-secure/safexcel.c:762:35: note: The result of the right shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long'
                   writel(EIP197_DxE_THR_CTRL_EN | GENMASK(priv->config.rings - 1, 0),
                                                   ^
   include/linux/bits.h:38:31: note: expanded from macro 'GENMASK'
           (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
                                        ^
   include/linux/bits.h:36:11: note: expanded from macro '__GENMASK'
            (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
                    ^
   arch/arm/include/asm/io.h:307:51: note: expanded from macro 'writel'
   #define writel(v,c)             ({ __iowmb(); writel_relaxed(v,c); })
                                                 ~~~~~~~~~~~~~~~^~~~
   arch/arm/include/asm/io.h:299:68: note: expanded from macro 'writel_relaxed'
   #define writel_relaxed(v,c)     __raw_writel((__force u32) cpu_to_le32(v),c)
                                                              ~~~~~~~~~~~~^~
   include/uapi/linux/byteorder/little_endian.h:33:51: note: expanded from macro '__cpu_to_le32'
   #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
                                                     ^
   Suppressed 16 warnings (16 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   15 warnings generated.
   Suppressed 15 warnings (15 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.
   17 warnings generated.
   drivers/iio/imu/adis16400.c:179:8: warning: Excessive padding in 'struct adis16400_state' (112 padding bytes, where 48 is optimal). Optimal fields order: adis, variant, filt_int, avail_scan_mask, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct adis16400_state {
   ~~~~~~~^~~~~~~~~~~~~~~~~
   drivers/iio/imu/adis16400.c:179:8: note: Excessive padding in 'struct adis16400_state' (112 padding bytes, where 48 is optimal). Optimal fields order: adis, variant, filt_int, avail_scan_mask, consider reordering the fields or adding explicit padding members
   struct adis16400_state {
   ~~~~~~~^~~~~~~~~~~~~~~~~
   Suppressed 16 warnings (16 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.
   17 warnings generated.
   drivers/iio/imu/adis16475.c:100:8: warning: Excessive padding in 'struct adis16475' (73 padding bytes, where 9 is optimal). Optimal fields order: adis, data, info, clk_freq, lsb_flag, sync_mode, burst32, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct adis16475 {
   ~~~~~~~^~~~~~~~~~~
   drivers/iio/imu/adis16475.c:100:8: note: Excessive padding in 'struct adis16475' (73 padding bytes, where 9 is optimal). Optimal fields order: adis, data, info, clk_freq, lsb_flag, sync_mode, burst32, consider reordering the fields or adding explicit padding members
   struct adis16475 {
   ~~~~~~~^~~~~~~~~~~
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   17 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 16 warnings (16 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.
   17 warnings generated.
>> drivers/iio/adc/ad7476.c:39:8: warning: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct ad7476_state {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/iio/adc/ad7476.c:39:8: note: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit padding members
   struct ad7476_state {
   ~~~~~~~^~~~~~~~~~~~~~
   Suppressed 16 warnings (16 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.
   16 warnings generated.
   Suppressed 16 warnings (16 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.
   32 warnings generated.
   net/9p/client.c:541:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = p9pdu_readf(&req->rc, c->proto_version, "d", &ecode);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/9p/client.c:541:3: note: Value stored to 'err' is never read
                   err = p9pdu_readf(&req->rc, c->proto_version, "d", &ecode);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/9p/client.c:628:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = p9pdu_readf(&req->rc, c->proto_version, "d", &ecode);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/9p/client.c:628:3: note: Value stored to 'err' is never read
                   err = p9pdu_readf(&req->rc, c->proto_version, "d", &ecode);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/9p/client.c:1008:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:1008:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:1175:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:1175:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:1252:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:1252:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:1344:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:1344:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:1713:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:1713:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:1766:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:1766:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:1916:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:1916:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2018:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2018:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2095:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2095:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2155:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2155:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2186:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2186:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2216:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2216:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2249:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2249:2: note: Value stored to 'err' is never read
           err = 0;

vim +39 drivers/iio/adc/ad7476.c

7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  38  
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10 @39  struct ad7476_state {
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  40  	struct spi_device		*spi;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  41  	const struct ad7476_chip_info	*chip_info;
7bf50a968a1cd0 drivers/iio/adc/ad7476.c         Jonathan Cameron   2021-04-25  42  	struct regulator		*ref_reg;
af37e4703d00ce drivers/iio/adc/ad7476.c         Dragos Bogdan      2020-03-11  43  	struct gpio_desc		*convst_gpio;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  44  	struct spi_transfer		xfer;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  45  	struct spi_message		msg;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  46  	/*
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  47  	 * DMA (thus cache coherency maintenance) requires the
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  48  	 * transfer buffers to live in their own cache lines.
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  49  	 * Make the buffer large enough for one 16 bit sample and one 64 bit
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  50  	 * aligned 64 bit timestamp.
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  51  	 */
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  52  	unsigned char data[ALIGN(2, sizeof(s64)) + sizeof(s64)]
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  53  			____cacheline_aligned;
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  54  };
7a28fe3c93d6cd drivers/staging/iio/adc/ad7476.c Lars-Peter Clausen 2012-09-10  55  

:::::: The code at line 39 was first introduced by commit
:::::: 7a28fe3c93d6cd920c84678a1bf45af8b4248577 staging:iio:ad7476: Squash driver into a single file.

:::::: TO: Lars-Peter Clausen <lars@metafoo.de>
:::::: CC: Jonathan Cameron <jic23@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

end of thread, other threads:[~2022-07-13 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-09 12:20 drivers/iio/adc/ad7476.c:39:8: warning: Excessive padding in 'struct ad7476_state' (72 padding bytes, where 8 is optimal). Optimal fields order: data, spi, chip_info, ref_reg, convst_gpio, msg, xfer, consider reordering the fields or adding explicit paddi kernel test robot
2022-07-13 23:05 kernel test robot

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.