All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal).
@ 2022-01-27 23:13 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-01-27 23:13 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 17568 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Adam Ford <aford173@gmail.com>
CC: Shawn Guo <shawnguo@kernel.org>
CC: Fabio Estevam <festevam@gmail.com>
CC: Lucas Stach <l.stach@pengutronix.de>
CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   626b2dda7651a7c766108db4cdc0825db05b980d
commit: 042b67799e2991e301df8269e166d8bc5944495e soc: imx: imx8m-blk-ctrl: Fix imx8mm mipi reset
date:   8 weeks ago
:::::: branch date: 14 hours ago
:::::: commit date: 8 weeks ago
config: riscv-randconfig-c006-20220121 (https://download.01.org/0day-ci/archive/20220128/202201280737.ElKaQTXl-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d4baf3b1322b84816aa623d8e8cb45a49cb68b84)
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/torvalds/linux.git/commit/?id=042b67799e2991e301df8269e166d8bc5944495e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 042b67799e2991e301df8269e166d8bc5944495e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   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.
   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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   14 warnings generated.
   drivers/input/rmi4/rmi_f11.c:1129:2: warning: Value stored to 'query_offset' is never read [clang-analyzer-deadcode.DeadStores]
           query_offset += rc;
           ^               ~~
   drivers/input/rmi4/rmi_f11.c:1129:2: note: Value stored to 'query_offset' is never read
           query_offset += rc;
           ^               ~~
   Suppressed 13 warnings (6 in non-user code, 7 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.
   16 warnings generated.
   drivers/input/rmi4/rmi_f12.c:133:3: warning: Value stored to 'offset' is never read [clang-analyzer-deadcode.DeadStores]
                   offset += 1;
                   ^         ~
   drivers/input/rmi4/rmi_f12.c:133:3: note: Value stored to 'offset' is never read
                   offset += 1;
                   ^         ~
   drivers/input/rmi4/rmi_f12.c:401:2: warning: Value stored to 'query_addr' is never read [clang-analyzer-deadcode.DeadStores]
           query_addr += 3;
           ^             ~
   drivers/input/rmi4/rmi_f12.c:401:2: note: Value stored to 'query_addr' is never read
           query_addr += 3;
           ^             ~
   drivers/input/rmi4/rmi_f12.c:520:3: warning: Value stored to 'data_offset' is never read [clang-analyzer-deadcode.DeadStores]
                   data_offset += item->reg_size;
                   ^              ~~~~~~~~~~~~~~
   drivers/input/rmi4/rmi_f12.c:520:3: note: Value stored to 'data_offset' is never read
                   data_offset += item->reg_size;
                   ^              ~~~~~~~~~~~~~~
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   14 warnings generated.
>> drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   name, 
   clk_names, 
   gpc_name, 
   num_clks, 
   rst_mask, 
   clk_mask, 
   mipi_phy_rst_mask, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soc/imx/imx8m-blk-ctrl.c:33:8: note: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). Optimal fields order: name, clk_names, gpc_name, num_clks, rst_mask, clk_mask, mipi_phy_rst_mask, consider reordering the fields or adding explicit padding members
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   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.
   15 warnings generated.
   fs/ntfs3/inode.c:372:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   fs/ntfs3/inode.c:372:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   Suppressed 14 warnings (7 in non-user code, 7 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.
   fs/ntfs3/index.c:2463:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2463:3: note: Value stored to 'err' is never read
                   err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2465:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = ni_remove_attr(ni, ATTR_ALLOC, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2465:3: note: Value stored to 'err' is never read
                   err = ni_remove_attr(ni, ATTR_ALLOC, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2469:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2469:3: note: Value stored to 'err' is never read
                   err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   15 warnings generated.
   Suppressed 15 warnings (8 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   drivers/clk/clk-bm1880.c:106:8: warning: Excessive padding in 'struct bm1880_composite_clock' (14 padding bytes, where 6 is optimal). 
   Optimal fields order: 
   name, 
   parent, 
   parents, 
   flags, 
   table, 
   id, 
   num_parents, 
   gate_reg, 
   mux_reg, 
   div_reg, 
   div_initval, 
   gate_shift, 

vim +33 drivers/soc/imx/imx8m-blk-ctrl.c

2684ac05a8c4d2d Lucas Stach 2021-10-02  32  
2684ac05a8c4d2d Lucas Stach 2021-10-02 @33  struct imx8m_blk_ctrl_domain_data {
2684ac05a8c4d2d Lucas Stach 2021-10-02  34  	const char *name;
2684ac05a8c4d2d Lucas Stach 2021-10-02  35  	const char * const *clk_names;
2684ac05a8c4d2d Lucas Stach 2021-10-02  36  	int num_clks;
2684ac05a8c4d2d Lucas Stach 2021-10-02  37  	const char *gpc_name;
2684ac05a8c4d2d Lucas Stach 2021-10-02  38  	u32 rst_mask;
2684ac05a8c4d2d Lucas Stach 2021-10-02  39  	u32 clk_mask;
042b67799e2991e Adam Ford   2021-11-28  40  
042b67799e2991e Adam Ford   2021-11-28  41  	/*
042b67799e2991e Adam Ford   2021-11-28  42  	 * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register
042b67799e2991e Adam Ford   2021-11-28  43  	 * which is used to control the reset for the MIPI Phy.
042b67799e2991e Adam Ford   2021-11-28  44  	 * Since it's only present in certain circumstances,
042b67799e2991e Adam Ford   2021-11-28  45  	 * an if-statement should be used before setting and clearing this
042b67799e2991e Adam Ford   2021-11-28  46  	 * register.
042b67799e2991e Adam Ford   2021-11-28  47  	 */
042b67799e2991e Adam Ford   2021-11-28  48  	u32 mipi_phy_rst_mask;
2684ac05a8c4d2d Lucas Stach 2021-10-02  49  };
2684ac05a8c4d2d Lucas Stach 2021-10-02  50  

:::::: The code at line 33 was first introduced by commit
:::::: 2684ac05a8c4d2d5c49e6c11eb6206b30a284813 soc: imx: add i.MX8M blk-ctrl driver

:::::: TO: Lucas Stach <l.stach@pengutronix.de>
:::::: CC: Shawn Guo <shawnguo@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

* drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal).
@ 2022-02-02 18:56 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-02-02 18:56 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 17910 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Adam Ford <aford173@gmail.com>
CC: Shawn Guo <shawnguo@kernel.org>
CC: Fabio Estevam <festevam@gmail.com>
CC: Lucas Stach <l.stach@pengutronix.de>
CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9f7fb8de5d9bac17b6392a14af40baf555d9129b
commit: 042b67799e2991e301df8269e166d8bc5944495e soc: imx: imx8m-blk-ctrl: Fix imx8mm mipi reset
date:   8 weeks ago
:::::: branch date: 22 hours ago
:::::: commit date: 8 weeks ago
config: riscv-randconfig-c006-20220121 (https://download.01.org/0day-ci/archive/20220203/202202030245.cjg3G8GS-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d4baf3b1322b84816aa623d8e8cb45a49cb68b84)
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/torvalds/linux.git/commit/?id=042b67799e2991e301df8269e166d8bc5944495e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 042b67799e2991e301df8269e166d8bc5944495e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   fs/hfsplus/super.c:231:2: warning: Value stored to 'error2' is never read [clang-analyzer-deadcode.DeadStores]
           error2 = hfsplus_submit_bio(sb,
           ^        ~~~~~~~~~~~~~~~~~~~~~~
   fs/hfsplus/super.c:231:2: note: Value stored to 'error2' is never read
           error2 = hfsplus_submit_bio(sb,
           ^        ~~~~~~~~~~~~~~~~~~~~~~
   fs/hfsplus/super.c:236:3: warning: Value stored to 'error2' is never read [clang-analyzer-deadcode.DeadStores]
                   error2 = error;
                   ^        ~~~~~
   fs/hfsplus/super.c:236:3: note: Value stored to 'error2' is never read
                   error2 = error;
                   ^        ~~~~~
   fs/hfsplus/super.c:570:5: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                                   err = 0; /* Operation is not supported. */
                                   ^     ~
   fs/hfsplus/super.c:570:5: note: Value stored to 'err' is never read
                                   err = 0; /* Operation is not supported. */
                                   ^     ~
   Suppressed 15 warnings (8 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   16 warnings generated.
   fs/hfsplus/bnode.c:328:4: warning: Value stored to 'tmp' is never read [clang-analyzer-deadcode.DeadStores]
                           tmp = hfs_bnode_read_u16(node, key_off);
                           ^
   fs/hfsplus/bnode.c:328:4: note: Value stored to 'tmp' is never read
   Suppressed 15 warnings (8 in non-user code, 7 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.
   15 warnings generated.
   fs/ntfs3/inode.c:372:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   fs/ntfs3/inode.c:372:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   Suppressed 14 warnings (7 in non-user code, 7 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.
   fs/ntfs3/index.c:2463:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2463:3: note: Value stored to 'err' is never read
                   err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2465:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = ni_remove_attr(ni, ATTR_ALLOC, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2465:3: note: Value stored to 'err' is never read
                   err = ni_remove_attr(ni, ATTR_ALLOC, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2469:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
                   err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/index.c:2469:3: note: Value stored to 'err' is never read
                   err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   15 warnings generated.
   Suppressed 15 warnings (8 in non-user code, 7 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.
   14 warnings generated.
   Suppressed 14 warnings (7 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   14 warnings generated.
>> drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   name, 
   clk_names, 
   gpc_name, 
   num_clks, 
   rst_mask, 
   clk_mask, 
   mipi_phy_rst_mask, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soc/imx/imx8m-blk-ctrl.c:33:8: note: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). Optimal fields order: name, clk_names, gpc_name, num_clks, rst_mask, clk_mask, mipi_phy_rst_mask, consider reordering the fields or adding explicit padding members
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 13 warnings (6 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   13 warnings generated.
   Suppressed 13 warnings (6 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   12 warnings generated.
   Suppressed 12 warnings (5 in non-user code, 7 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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   13 warnings generated.
   drivers/gpio/gpio-bcm-kona.c:285:30: warning: The result of the left shift is undefined due to shifting by '4294967294', which is greater or equal to the width of type 'unsigned long' [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   if (res > 0 && (debounce & BIT(res - 1)))
                                              ^
   include/vdso/bits.h:7:26: note: expanded from macro 'BIT'
   #define BIT(nr)                 (UL(1) << (nr))
                                          ^
   drivers/gpio/gpio-bcm-kona.c:315:6: note: Assuming the condition is false
           if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpio/gpio-bcm-kona.c:315:2: note: Taking false branch
           if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
           ^
   drivers/gpio/gpio-bcm-kona.c:319:9: note: Calling 'bcm_kona_gpio_set_debounce'
           return bcm_kona_gpio_set_debounce(chip, gpio, debounce);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpio/gpio-bcm-kona.c:272:7: note: Assuming 'debounce' is > 0
           if ((debounce > 0 && debounce < 1000) || debounce > 128000) {
                ^~~~~~~~~~~~
   drivers/gpio/gpio-bcm-kona.c:272:7: note: Left side of '&&' is true
   drivers/gpio/gpio-bcm-kona.c:272:23: note: Assuming 'debounce' is >= 1000
           if ((debounce > 0 && debounce < 1000) || debounce > 128000) {
                                ^~~~~~~~~~~~~~~
   drivers/gpio/gpio-bcm-kona.c:272:6: note: Left side of '||' is false
           if ((debounce > 0 && debounce < 1000) || debounce > 128000) {
               ^
   drivers/gpio/gpio-bcm-kona.c:272:43: note: Assuming 'debounce' is <= 128000
           if ((debounce > 0 && debounce < 1000) || debounce > 128000) {
                                                    ^~~~~~~~~~~~~~~~~
   drivers/gpio/gpio-bcm-kona.c:272:2: note: Taking false branch
           if ((debounce > 0 && debounce < 1000) || debounce > 128000) {
           ^
   drivers/gpio/gpio-bcm-kona.c:279:6: note: 'debounce' is not equal to 0
           if (debounce != 0) {
               ^~~~~~~~
   drivers/gpio/gpio-bcm-kona.c:279:2: note: Taking true branch
           if (debounce != 0) {
           ^
   drivers/gpio/gpio-bcm-kona.c:285:7: note: 'res' is > 0
                   if (res > 0 && (debounce & BIT(res - 1)))
                       ^~~
   drivers/gpio/gpio-bcm-kona.c:285:7: note: Left side of '&&' is true
   drivers/gpio/gpio-bcm-kona.c:285:30: note: The result of the left shift is undefined due to shifting by '4294967294', which is greater or equal to the width of type 'unsigned long'
                   if (res > 0 && (debounce & BIT(res - 1)))
                                              ^

vim +33 drivers/soc/imx/imx8m-blk-ctrl.c

2684ac05a8c4d2d Lucas Stach 2021-10-02  32  
2684ac05a8c4d2d Lucas Stach 2021-10-02 @33  struct imx8m_blk_ctrl_domain_data {
2684ac05a8c4d2d Lucas Stach 2021-10-02  34  	const char *name;
2684ac05a8c4d2d Lucas Stach 2021-10-02  35  	const char * const *clk_names;
2684ac05a8c4d2d Lucas Stach 2021-10-02  36  	int num_clks;
2684ac05a8c4d2d Lucas Stach 2021-10-02  37  	const char *gpc_name;
2684ac05a8c4d2d Lucas Stach 2021-10-02  38  	u32 rst_mask;
2684ac05a8c4d2d Lucas Stach 2021-10-02  39  	u32 clk_mask;
042b67799e2991e Adam Ford   2021-11-28  40  
042b67799e2991e Adam Ford   2021-11-28  41  	/*
042b67799e2991e Adam Ford   2021-11-28  42  	 * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register
042b67799e2991e Adam Ford   2021-11-28  43  	 * which is used to control the reset for the MIPI Phy.
042b67799e2991e Adam Ford   2021-11-28  44  	 * Since it's only present in certain circumstances,
042b67799e2991e Adam Ford   2021-11-28  45  	 * an if-statement should be used before setting and clearing this
042b67799e2991e Adam Ford   2021-11-28  46  	 * register.
042b67799e2991e Adam Ford   2021-11-28  47  	 */
042b67799e2991e Adam Ford   2021-11-28  48  	u32 mipi_phy_rst_mask;
2684ac05a8c4d2d Lucas Stach 2021-10-02  49  };
2684ac05a8c4d2d Lucas Stach 2021-10-02  50  

:::::: The code at line 33 was first introduced by commit
:::::: 2684ac05a8c4d2d5c49e6c11eb6206b30a284813 soc: imx: add i.MX8M blk-ctrl driver

:::::: TO: Lucas Stach <l.stach@pengutronix.de>
:::::: CC: Shawn Guo <shawnguo@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

* drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal).
@ 2022-02-06  1:48 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-02-06  1:48 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 16195 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Adam Ford <aford173@gmail.com>
CC: Shawn Guo <shawnguo@kernel.org>
CC: Fabio Estevam <festevam@gmail.com>
CC: Lucas Stach <l.stach@pengutronix.de>
CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   90c9e950c0def5c354b4a6154a2ddda3e5f214ac
commit: 042b67799e2991e301df8269e166d8bc5944495e soc: imx: imx8m-blk-ctrl: Fix imx8mm mipi reset
date:   9 weeks ago
:::::: branch date: 6 hours ago
:::::: commit date: 9 weeks ago
config: riscv-randconfig-c006-20220206 (https://download.01.org/0day-ci/archive/20220206/202202060816.6rq608xQ-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project dee058c670593b999fec19c458dbbd882ad9de56)
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/torvalds/linux.git/commit/?id=042b67799e2991e301df8269e166d8bc5944495e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 042b67799e2991e301df8269e166d8bc5944495e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
                        ^~~~~
   drivers/mtd/nand/raw/nand_toshiba.c:62:15: note: Assuming 'i' is < field 'steps'
                   for (i = 0; i < chip->ecc.steps; i++) {
                               ^~~~~~~~~~~~~~~~~~~
   drivers/mtd/nand/raw/nand_toshiba.c:62:3: note: Loop condition is true.  Entering loop body
                   for (i = 0; i < chip->ecc.steps; i++) {
                   ^
   drivers/mtd/nand/raw/nand_toshiba.c:63:29: note: The left operand of '&' is a garbage value
                           bitflips = ecc_status[i] & TOSHIBA_NAND_ECC_STATUS_MASK;
                                      ~~~~~~~~~~~~~ ^
   Suppressed 6 warnings (6 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/mtd/chips/cfi_cmdset_0020.c:714:29: warning: The right operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                           memcpy(buffer, elem_base + thislen, buflen);
                                                    ^ ~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:667:22: note: 'thislen' declared without an initial value
           size_t   totlen = 0, thislen;
                                ^~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:672:6: note: Assuming field 'writesize' is not equal to 0
           if (!ECCBUF_SIZE) {
               ^~~~~~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:672:2: note: Taking false branch
           if (!ECCBUF_SIZE) {
           ^
   drivers/mtd/chips/cfi_cmdset_0020.c:678:11: note: Calling 'kmalloc'
           buffer = kmalloc(ECCBUF_SIZE, GFP_KERNEL);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:578:2: note: Taking false branch
           if (__builtin_constant_p(size)) {
           ^
   include/linux/slab.h:595:2: note: Returning pointer, which participates in a condition later
           return __kmalloc(size, flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:678:11: note: Returning from 'kmalloc'
           buffer = kmalloc(ECCBUF_SIZE, GFP_KERNEL);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:679:6: note: Assuming 'buffer' is non-null
           if (!buffer)
               ^~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:679:2: note: Taking false branch
           if (!buffer)
           ^
   drivers/mtd/chips/cfi_cmdset_0020.c:682:12: note: Assuming 'i' is < 'count'
           for (i=0; i<count; i++) {
                     ^~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:682:2: note: Loop condition is true.  Entering loop body
           for (i=0; i<count; i++) {
           ^
   drivers/mtd/chips/cfi_cmdset_0020.c:685:7: note: Assuming 'elem_len' is not equal to 0
                   if (!elem_len) /* FIXME: Might be unnecessary. Check that */
                       ^~~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:685:3: note: Taking false branch
                   if (!elem_len) /* FIXME: Might be unnecessary. Check that */
                   ^
   drivers/mtd/chips/cfi_cmdset_0020.c:687:7: note: 'buflen' is 0
                   if (buflen) { /* cut off head */
                       ^~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:687:3: note: Taking false branch
                   if (buflen) { /* cut off head */
                   ^
   drivers/mtd/chips/cfi_cmdset_0020.c:703:7: note: Assuming the condition is false
                   if (ECCBUF_DIV(elem_len)) { /* write clean aligned data */
                       ^
   drivers/mtd/chips/cfi_cmdset_0020.c:660:24: note: expanded from macro 'ECCBUF_DIV'
   #define ECCBUF_DIV(x) ((x) & ~(ECCBUF_SIZE - 1))
                          ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:703:3: note: Taking false branch
                   if (ECCBUF_DIV(elem_len)) { /* write clean aligned data */
                   ^
   drivers/mtd/chips/cfi_cmdset_0020.c:712:7: note: Assuming 'buflen' is not equal to 0
                   if (buflen) {
                       ^~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:712:3: note: Taking true branch
                   if (buflen) {
                   ^
   drivers/mtd/chips/cfi_cmdset_0020.c:714:29: note: The right operand of '+' is a garbage value
                           memcpy(buffer, elem_base + thislen, buflen);
                                                    ^ ~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:1035:16: warning: Value stored to 'timeo' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long timeo = jiffies + HZ;
                         ^~~~~   ~~~~~~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:1035:16: note: Value stored to 'timeo' during its initialization is never read
           unsigned long timeo = jiffies + HZ;
                         ^~~~~   ~~~~~~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:1181:16: warning: Value stored to 'timeo' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long timeo = jiffies + HZ;
                         ^~~~~   ~~~~~~~~~~~~
   drivers/mtd/chips/cfi_cmdset_0020.c:1181:16: note: Value stored to 'timeo' during its initialization is never read
           unsigned long timeo = jiffies + HZ;
                         ^~~~~   ~~~~~~~~~~~~
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   name, 
   clk_names, 
   gpc_name, 
   num_clks, 
   rst_mask, 
   clk_mask, 
   mipi_phy_rst_mask, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soc/imx/imx8m-blk-ctrl.c:33:8: note: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). Optimal fields order: name, clk_names, gpc_name, num_clks, rst_mask, clk_mask, mipi_phy_rst_mask, consider reordering the fields or adding explicit padding members
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   8 warnings generated.
   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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   8 warnings generated.
   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.
   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.
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   8 warnings generated.
   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.
   10 warnings generated.
   drivers/media/i2c/ov9650.c:606:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = ov965x_write(ov965x, REG_COM8, reg);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov9650.c:606:3: note: Value stored to 'ret' is never read
                   ret = ov965x_write(ov965x, REG_COM8, reg);
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov9650.c:877:12: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'int' [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   m = 0x01 << fls(gain >> 4);
                            ^
   drivers/media/i2c/ov9650.c:905:27: note: Calling 'ctrl_to_sd'
           struct v4l2_subdev *sd = ctrl_to_sd(ctrl);
                                    ^~~~~~~~~~~~~~~~
   drivers/media/i2c/ov9650.c:417:2: note: Returning without writing to 'ctrl->id', which participates in a condition later
           return &container_of(ctrl->handler, struct ov965x, ctrls.handler)->sd;
           ^
   drivers/media/i2c/ov9650.c:417:2: note: Returning without writing to 'ctrl->val', which participates in a condition later
   drivers/media/i2c/ov9650.c:905:27: note: Returning from 'ctrl_to_sd'
           struct v4l2_subdev *sd = ctrl_to_sd(ctrl);
                                    ^~~~~~~~~~~~~~~~
   drivers/media/i2c/ov9650.c:909:14: note: Assuming 'debug' is < 1
           v4l2_dbg(1, debug, sd, "g_ctrl: %s\n", ctrl->name);
                       ^
   include/media/v4l2-common.h:73:7: note: expanded from macro 'v4l2_dbg'
                   if (debug >= (level))                                   \
                       ^~~~~~~~~~~~~~~~
   drivers/media/i2c/ov9650.c:909:2: note: Taking false branch
           v4l2_dbg(1, debug, sd, "g_ctrl: %s\n", ctrl->name);
           ^
   include/media/v4l2-common.h:73:3: note: expanded from macro 'v4l2_dbg'
                   if (debug >= (level))                                   \
                   ^
   drivers/media/i2c/ov9650.c:909:2: note: Loop condition is false.  Exiting loop
           v4l2_dbg(1, debug, sd, "g_ctrl: %s\n", ctrl->name);
           ^
   include/media/v4l2-common.h:72:2: note: expanded from macro 'v4l2_dbg'
           do {                                                            \
           ^
   drivers/media/i2c/ov9650.c:912:8: note: Calling '__g_volatile_ctrl'
           ret = __g_volatile_ctrl(ov965x, ctrl);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/ov9650.c:863:6: note: Assuming field 'power' is not equal to 0
           if (!ov965x->power)
               ^~~~~~~~~~~~~~
   drivers/media/i2c/ov9650.c:863:2: note: Taking false branch
           if (!ov965x->power)
           ^
   drivers/media/i2c/ov9650.c:866:2: note: Control jumps to 'case 9963794:'  at line 867
           switch (ctrl->id) {
           ^
   drivers/media/i2c/ov9650.c:868:7: note: Assuming field 'val' is not equal to 0

vim +33 drivers/soc/imx/imx8m-blk-ctrl.c

2684ac05a8c4d2 Lucas Stach 2021-10-02  32  
2684ac05a8c4d2 Lucas Stach 2021-10-02 @33  struct imx8m_blk_ctrl_domain_data {
2684ac05a8c4d2 Lucas Stach 2021-10-02  34  	const char *name;
2684ac05a8c4d2 Lucas Stach 2021-10-02  35  	const char * const *clk_names;
2684ac05a8c4d2 Lucas Stach 2021-10-02  36  	int num_clks;
2684ac05a8c4d2 Lucas Stach 2021-10-02  37  	const char *gpc_name;
2684ac05a8c4d2 Lucas Stach 2021-10-02  38  	u32 rst_mask;
2684ac05a8c4d2 Lucas Stach 2021-10-02  39  	u32 clk_mask;
042b67799e2991 Adam Ford   2021-11-28  40  
042b67799e2991 Adam Ford   2021-11-28  41  	/*
042b67799e2991 Adam Ford   2021-11-28  42  	 * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register
042b67799e2991 Adam Ford   2021-11-28  43  	 * which is used to control the reset for the MIPI Phy.
042b67799e2991 Adam Ford   2021-11-28  44  	 * Since it's only present in certain circumstances,
042b67799e2991 Adam Ford   2021-11-28  45  	 * an if-statement should be used before setting and clearing this
042b67799e2991 Adam Ford   2021-11-28  46  	 * register.
042b67799e2991 Adam Ford   2021-11-28  47  	 */
042b67799e2991 Adam Ford   2021-11-28  48  	u32 mipi_phy_rst_mask;
2684ac05a8c4d2 Lucas Stach 2021-10-02  49  };
2684ac05a8c4d2 Lucas Stach 2021-10-02  50  

:::::: The code at line 33 was first introduced by commit
:::::: 2684ac05a8c4d2d5c49e6c11eb6206b30a284813 soc: imx: add i.MX8M blk-ctrl driver

:::::: TO: Lucas Stach <l.stach@pengutronix.de>
:::::: CC: Shawn Guo <shawnguo@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

* drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal).
@ 2022-03-21  6:36 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-03-21  6:36 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 14762 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Adam Ford <aford173@gmail.com>
CC: Shawn Guo <shawnguo@kernel.org>
CC: Fabio Estevam <festevam@gmail.com>
CC: Lucas Stach <l.stach@pengutronix.de>
CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f443e374ae131c168a065ea1748feac6b2e76613
commit: 042b67799e2991e301df8269e166d8bc5944495e soc: imx: imx8m-blk-ctrl: Fix imx8mm mipi reset
date:   4 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 4 months ago
config: riscv-randconfig-c006-20220313 (https://download.01.org/0day-ci/archive/20220321/202203211436.wGtFxoij-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 43f668b98e8d87290fc6bbf5ed13c3ab542e3497)
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/torvalds/linux.git/commit/?id=042b67799e2991e301df8269e166d8bc5944495e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 042b67799e2991e301df8269e166d8bc5944495e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   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.
   9 warnings generated.
   Suppressed 9 warnings (2 in non-user code, 7 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.
   3 warnings generated.
   Suppressed 3 warnings (2 in non-user code, 1 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 (2 in non-user code, 7 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.
   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.
   lib/bootconfig.c:169:15: warning: Access to field 'data' results in a dereference of a null pointer (loaded from variable 'node') [clang-analyzer-core.NullDereference]
           int offset = node->data & ~XBC_VALUE;
                        ^
   lib/bootconfig.c:284:6: note: Assuming 'node' is non-null
           if (!node || node == root)
               ^~~~~
   lib/bootconfig.c:284:6: note: Left side of '||' is false
   lib/bootconfig.c:284:15: note: Assuming 'node' is not equal to 'root'
           if (!node || node == root)
                        ^~~~~~~~~~~~
   lib/bootconfig.c:284:2: note: Taking false branch
           if (!node || node == root)
           ^
   lib/bootconfig.c:287:6: note: Assuming the condition is false
           if (xbc_node_is_value(node))
               ^~~~~~~~~~~~~~~~~~~~~~~
   lib/bootconfig.c:287:2: note: Taking false branch
           if (xbc_node_is_value(node))
           ^
   lib/bootconfig.c:290:9: note: 'node' is non-null
           while (node && node != root) {
                  ^~~~
   lib/bootconfig.c:290:9: note: Left side of '&&' is true
   lib/bootconfig.c:290:17: note: 'node' is not equal to 'root'
           while (node && node != root) {
                          ^~~~
   lib/bootconfig.c:290:2: note: Loop condition is true.  Entering loop body
           while (node && node != root) {
           ^
   lib/bootconfig.c:292:7: note: 'depth' is not equal to XBC_DEPTH_MAX
                   if (depth == XBC_DEPTH_MAX)
                       ^~~~~
   lib/bootconfig.c:292:3: note: Taking false branch
                   if (depth == XBC_DEPTH_MAX)
                   ^
   lib/bootconfig.c:294:10: note: Calling 'xbc_node_get_parent'
                   node = xbc_node_get_parent(node);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
   lib/bootconfig.c:131:9: note: Assuming field 'parent' is not equal to XBC_NODE_MAX
           return node->parent == XBC_NODE_MAX ? NULL : &xbc_nodes[node->parent];
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/bootconfig.c:131:9: note: '?' condition is false
   lib/bootconfig.c:131:2: note: Returning pointer, which participates in a condition later
           return node->parent == XBC_NODE_MAX ? NULL : &xbc_nodes[node->parent];
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/bootconfig.c:294:10: note: Returning from 'xbc_node_get_parent'
                   node = xbc_node_get_parent(node);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
   lib/bootconfig.c:290:9: note: Assuming 'node' is null
           while (node && node != root) {
                  ^~~~
   lib/bootconfig.c:290:14: note: Left side of '&&' is false
           while (node && node != root) {
                       ^
   lib/bootconfig.c:296:7: note: 'node' is null
           if (!node && root)
                ^~~~
   lib/bootconfig.c:296:6: note: Left side of '&&' is true
           if (!node && root)
               ^
   lib/bootconfig.c:296:15: note: Assuming 'root' is null
           if (!node && root)
                        ^~~~
   lib/bootconfig.c:296:2: note: Taking false branch
           if (!node && root)
           ^
   lib/bootconfig.c:299:2: note: Loop condition is true.  Entering loop body
           while (--depth >= 0) {
           ^
   lib/bootconfig.c:300:3: note: Null pointer value stored to 'node'
                   node = xbc_nodes + keys[depth];
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/bootconfig.c:301:55: note: Passing null pointer value via 1st parameter 'node'
                   ret = snprintf(buf, size, "%s%s", xbc_node_get_data(node),
                                                                       ^~~~
   lib/bootconfig.c:301:37: note: Calling 'xbc_node_get_data'
                   ret = snprintf(buf, size, "%s%s", xbc_node_get_data(node),
                                                     ^~~~~~~~~~~~~~~~~~~~~~~
   lib/bootconfig.c:169:15: note: Access to field 'data' results in a dereference of a null pointer (loaded from variable 'node')
           int offset = node->data & ~XBC_VALUE;
                        ^~~~
   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.
   10 warnings generated.
>> drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   name, 
   clk_names, 
   gpc_name, 
   num_clks, 
   rst_mask, 
   clk_mask, 
   mipi_phy_rst_mask, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soc/imx/imx8m-blk-ctrl.c:33:8: note: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). Optimal fields order: name, clk_names, gpc_name, num_clks, rst_mask, clk_mask, mipi_phy_rst_mask, consider reordering the fields or adding explicit padding members
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 9 warnings (2 in non-user code, 7 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 (2 in non-user code, 7 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 (2 in non-user code, 7 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.
   41 warnings generated.
   drivers/soc/mediatek/mtk-devapc.c:133:13: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'int' [clang-analyzer-core.UndefinedBinaryOperatorResult]
           writel(0x1 << min_shift_group, pd_vio_shift_sel_reg);
                      ^
   drivers/soc/mediatek/mtk-devapc.c:190:9: note: Calling 'devapc_sync_vio_dbg'
           while (devapc_sync_vio_dbg(ctx))
                  ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soc/mediatek/mtk-devapc.c:126:8: note: Loop condition is false.  Exiting loop
           val = readl(pd_vio_shift_sta_reg);
                 ^
   arch/riscv/include/asm/mmio.h:140:30: note: expanded from macro 'readl'
   #define readl(c)        ({ u32 __v; __io_br(); __v = readl_cpu(c); __io_ar(__v); __v; })
                                       ^
   arch/riscv/include/asm/mmio.h:133:19: note: expanded from macro '__io_br'
   #define __io_br()       do {} while (0)
                           ^
   drivers/soc/mediatek/mtk-devapc.c:127:6: note: Assuming 'val' is not equal to 0
           if (!val)
               ^~~~
   drivers/soc/mediatek/mtk-devapc.c:127:2: note: Taking false branch
           if (!val)
           ^
   drivers/soc/mediatek/mtk-devapc.c:130:20: note: Calling '__ffs'
           min_shift_group = __ffs(val);
                             ^~~~~~~~~~
   include/asm-generic/bitops/__ffs.h:18:6: note: Assuming the condition is true
           if ((word & 0xffffffff) == 0) {
               ^~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/__ffs.h:18:2: note: Taking true branch
           if ((word & 0xffffffff) == 0) {
           ^
   include/asm-generic/bitops/__ffs.h:19:3: note: The value 32 is assigned to 'num'
                   num += 32;
                   ^~~~~~~~~
   include/asm-generic/bitops/__ffs.h:23:6: note: Assuming the condition is false
           if ((word & 0xffff) == 0) {
               ^~~~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/__ffs.h:23:2: note: Taking false branch
           if ((word & 0xffff) == 0) {
           ^
   include/asm-generic/bitops/__ffs.h:27:6: note: Assuming the condition is false
           if ((word & 0xff) == 0) {
               ^~~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/__ffs.h:27:2: note: Taking false branch
           if ((word & 0xff) == 0) {
           ^
   include/asm-generic/bitops/__ffs.h:31:6: note: Assuming the condition is false
           if ((word & 0xf) == 0) {
               ^~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/__ffs.h:31:2: note: Taking false branch
           if ((word & 0xf) == 0) {
           ^
   include/asm-generic/bitops/__ffs.h:35:6: note: Assuming the condition is false
           if ((word & 0x3) == 0) {
               ^~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/__ffs.h:35:2: note: Taking false branch
           if ((word & 0x3) == 0) {
           ^
   include/asm-generic/bitops/__ffs.h:39:6: note: Assuming the condition is false
           if ((word & 0x1) == 0)
               ^~~~~~~~~~~~~~~~~
   include/asm-generic/bitops/__ffs.h:39:2: note: Taking false branch
           if ((word & 0x1) == 0)
           ^
   include/asm-generic/bitops/__ffs.h:41:2: note: Returning the value 32 (loaded from 'num')
           return num;
           ^~~~~~~~~~
   drivers/soc/mediatek/mtk-devapc.c:130:20: note: Returning from '__ffs'
           min_shift_group = __ffs(val);
                             ^~~~~~~~~~
   drivers/soc/mediatek/mtk-devapc.c:130:2: note: The value 32 is assigned to 'min_shift_group'
           min_shift_group = __ffs(val);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soc/mediatek/mtk-devapc.c:133:13: note: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'int'
           writel(0x1 << min_shift_group, pd_vio_shift_sel_reg);
                      ^
   arch/riscv/include/asm/mmio.h:144:48: note: expanded from macro 'writel'
   #define writel(v, c)    ({ __io_bw(); writel_cpu((v), (c)); __io_aw(); })

vim +33 drivers/soc/imx/imx8m-blk-ctrl.c

2684ac05a8c4d2 Lucas Stach 2021-10-02  32  
2684ac05a8c4d2 Lucas Stach 2021-10-02 @33  struct imx8m_blk_ctrl_domain_data {
2684ac05a8c4d2 Lucas Stach 2021-10-02  34  	const char *name;
2684ac05a8c4d2 Lucas Stach 2021-10-02  35  	const char * const *clk_names;
2684ac05a8c4d2 Lucas Stach 2021-10-02  36  	int num_clks;
2684ac05a8c4d2 Lucas Stach 2021-10-02  37  	const char *gpc_name;
2684ac05a8c4d2 Lucas Stach 2021-10-02  38  	u32 rst_mask;
2684ac05a8c4d2 Lucas Stach 2021-10-02  39  	u32 clk_mask;
042b67799e2991 Adam Ford   2021-11-28  40  
042b67799e2991 Adam Ford   2021-11-28  41  	/*
042b67799e2991 Adam Ford   2021-11-28  42  	 * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register
042b67799e2991 Adam Ford   2021-11-28  43  	 * which is used to control the reset for the MIPI Phy.
042b67799e2991 Adam Ford   2021-11-28  44  	 * Since it's only present in certain circumstances,
042b67799e2991 Adam Ford   2021-11-28  45  	 * an if-statement should be used before setting and clearing this
042b67799e2991 Adam Ford   2021-11-28  46  	 * register.
042b67799e2991 Adam Ford   2021-11-28  47  	 */
042b67799e2991 Adam Ford   2021-11-28  48  	u32 mipi_phy_rst_mask;
2684ac05a8c4d2 Lucas Stach 2021-10-02  49  };
2684ac05a8c4d2 Lucas Stach 2021-10-02  50  

:::::: The code@line 33 was first introduced by commit
:::::: 2684ac05a8c4d2d5c49e6c11eb6206b30a284813 soc: imx: add i.MX8M blk-ctrl driver

:::::: TO: Lucas Stach <l.stach@pengutronix.de>
:::::: CC: Shawn Guo <shawnguo@kernel.org>

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

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

* drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal).
@ 2022-04-10 20:29 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-04-10 20:29 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 15213 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Adam Ford <aford173@gmail.com>
CC: Shawn Guo <shawnguo@kernel.org>
CC: Fabio Estevam <festevam@gmail.com>
CC: Lucas Stach <l.stach@pengutronix.de>
CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4ea3c6425269d33da53c79d539ce9554117cf4d4
commit: 042b67799e2991e301df8269e166d8bc5944495e soc: imx: imx8m-blk-ctrl: Fix imx8mm mipi reset
date:   4 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 4 months ago
config: riscv-randconfig-c006-20220405 (https://download.01.org/0day-ci/archive/20220411/202204110441.1pioMIjH-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c4a1b07d0979e7ff20d7d541af666d822d66b566)
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/torvalds/linux.git/commit/?id=042b67799e2991e301df8269e166d8bc5944495e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 042b67799e2991e301df8269e166d8bc5944495e
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   fs/xfs/scrub/parent.c:179:2: note: Taking false branch
           if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) {
           ^
   fs/xfs/scrub/parent.c:191:6: note: Assuming the condition is false
           if (xfs_ilock_nowait(dp, XFS_IOLOCK_SHARED)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/scrub/parent.c:191:2: note: Taking false branch
           if (xfs_ilock_nowait(dp, XFS_IOLOCK_SHARED)) {
           ^
   fs/xfs/scrub/parent.c:210:6: note: Assuming 'error' is 0
           if (error)
               ^~~~~
   fs/xfs/scrub/parent.c:210:2: note: Taking false branch
           if (error)
           ^
   fs/xfs/scrub/parent.c:214:10: note: Calling 'xchk_parent_count_parent_dentries'
           error = xchk_parent_count_parent_dentries(sc, dp, &nlink);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/scrub/parent.c:92:6: note: Assuming field 'if_nextents' is > 0
           if (parent->i_df.if_nextents > 0)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/scrub/parent.c:92:2: note: Taking true branch
           if (parent->i_df.if_nextents > 0)
           ^
   fs/xfs/scrub/parent.c:95:6: note: Assuming 'error' is not equal to 0
           if (error)
               ^~~~~
   fs/xfs/scrub/parent.c:95:2: note: Taking true branch
           if (error)
           ^
   fs/xfs/scrub/parent.c:96:3: note: Returning without writing to '*nlink'
                   return error;
                   ^
   fs/xfs/scrub/parent.c:214:10: note: Returning from 'xchk_parent_count_parent_dentries'
           error = xchk_parent_count_parent_dentries(sc, dp, &nlink);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/scrub/parent.c:215:6: note: Assuming the condition is false
           if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/scrub/parent.c:215:2: note: Taking false branch
           if (!xchk_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
           ^
   fs/xfs/scrub/parent.c:221:6: note: Assuming 'error' is 0
           if (error)
               ^~~~~
   fs/xfs/scrub/parent.c:221:2: note: Taking false branch
           if (error)
           ^
   fs/xfs/scrub/parent.c:230:19: note: Assuming field 'i_nlink' is not equal to 0
           expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1;
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/scrub/parent.c:230:19: note: '?' condition is false
   fs/xfs/scrub/parent.c:234:6: note: Assuming the condition is false
           if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/scrub/parent.c:234:2: note: Taking false branch
           if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
           ^
   fs/xfs/scrub/parent.c:238:6: note: Assuming 'dnum' is equal to field 'i_ino'
           if (dnum != dp->i_ino) {
               ^~~~~~~~~~~~~~~~~
   fs/xfs/scrub/parent.c:238:2: note: Taking false branch
           if (dnum != dp->i_ino) {
           ^
   fs/xfs/scrub/parent.c:249:12: note: The left operand of '!=' is a garbage value
           if (nlink != expected_nlink)
               ~~~~~ ^
   Suppressed 9 warnings (2 in non-user code, 7 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.
   10 warnings generated.
   Suppressed 10 warnings (3 in non-user code, 7 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.
   10 warnings generated.
   Suppressed 10 warnings (3 in non-user code, 7 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 (2 in non-user code, 7 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.
   10 warnings generated.
   drivers/soc/aspeed/aspeed-lpc-ctrl.c:73:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = file->private_data;
                          ^~~   ~~~~~~~~~~~~~~~~~~
   drivers/soc/aspeed/aspeed-lpc-ctrl.c:73:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = file->private_data;
                          ^~~   ~~~~~~~~~~~~~~~~~~
   Suppressed 9 warnings (2 in non-user code, 7 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 (2 in non-user code, 7 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 (2 in non-user code, 7 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 (2 in non-user code, 7 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 (2 in non-user code, 7 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.
   10 warnings generated.
>> drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   name, 
   clk_names, 
   gpc_name, 
   num_clks, 
   rst_mask, 
   clk_mask, 
   mipi_phy_rst_mask, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/soc/imx/imx8m-blk-ctrl.c:33:8: note: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal). Optimal fields order: name, clk_names, gpc_name, num_clks, rst_mask, clk_mask, mipi_phy_rst_mask, consider reordering the fields or adding explicit padding members
   struct imx8m_blk_ctrl_domain_data {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 9 warnings (2 in non-user code, 7 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 (2 in non-user code, 7 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.
   3 warnings generated.
   drivers/leds/led-core.c:472:30: warning: Access to field 'name' results in a dereference of a null pointer [clang-analyzer-core.NullDereference]
                   strscpy(led_classdev_name, to_of_node(fwnode)->name,
                                              ^
   include/linux/of.h:161:2: note: expanded from macro 'to_of_node'
           ({                                                              \
           ^
   drivers/leds/led-core.c:424:2: note: Taking false branch
           BUG_ON(props.color == LED_COLOR_ID_MULTI);
           ^
   include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                  ^
   drivers/leds/led-core.c:424:2: note: Loop condition is false.  Exiting loop
           BUG_ON(props.color == LED_COLOR_ID_MULTI);
           ^
   include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                             ^
   drivers/leds/led-core.c:426:6: note: Assuming 'led_classdev_name' is non-null
           if (!led_classdev_name)
               ^~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:426:2: note: Taking false branch
           if (!led_classdev_name)
           ^
   drivers/leds/led-core.c:429:2: note: Calling 'led_parse_fwnode_props'
           led_parse_fwnode_props(dev, fwnode, &props);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:370:6: note: Assuming 'fwnode' is non-null
           if (!fwnode)
               ^~~~~~~
   drivers/leds/led-core.c:370:2: note: Taking false branch
           if (!fwnode)
           ^
   drivers/leds/led-core.c:373:6: note: Assuming the condition is false
           if (fwnode_property_present(fwnode, "label")) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:373:2: note: Taking false branch
           if (fwnode_property_present(fwnode, "label")) {
           ^
   drivers/leds/led-core.c:380:6: note: Assuming the condition is false
           if (fwnode_property_present(fwnode, "color")) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:380:2: note: Taking false branch
           if (fwnode_property_present(fwnode, "color")) {
           ^
   drivers/leds/led-core.c:391:6: note: Assuming the condition is true
           if (!fwnode_property_present(fwnode, "function"))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:391:2: note: Taking true branch
           if (!fwnode_property_present(fwnode, "function"))
           ^
   drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->label', which participates in a condition later
                   return;
                   ^
   drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->function', which participates in a condition later
   drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->color_present', which participates in a condition later
   drivers/leds/led-core.c:429:2: note: Returning from 'led_parse_fwnode_props'
           led_parse_fwnode_props(dev, fwnode, &props);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:431:12: note: Field 'label' is null
           if (props.label) {
                     ^
   drivers/leds/led-core.c:431:2: note: Taking false branch
           if (props.label) {
           ^
   drivers/leds/led-core.c:445:19: note: Field 'function' is null
           } else if (props.function || props.color_present) {
                            ^
   drivers/leds/led-core.c:445:13: note: Left side of '||' is false
           } else if (props.function || props.color_present) {
                      ^
   drivers/leds/led-core.c:445:37: note: Field 'color_present' is false
           } else if (props.function || props.color_present) {
                                              ^
   drivers/leds/led-core.c:445:9: note: Taking false branch
           } else if (props.function || props.color_present) {
                  ^
   drivers/leds/led-core.c:464:13: note: Assuming field 'default_label' is null
           } else if (init_data->default_label) {
                      ^~~~~~~~~~~~~~~~~~~~~~~~

vim +33 drivers/soc/imx/imx8m-blk-ctrl.c

2684ac05a8c4d2 Lucas Stach 2021-10-02  32  
2684ac05a8c4d2 Lucas Stach 2021-10-02 @33  struct imx8m_blk_ctrl_domain_data {
2684ac05a8c4d2 Lucas Stach 2021-10-02  34  	const char *name;
2684ac05a8c4d2 Lucas Stach 2021-10-02  35  	const char * const *clk_names;
2684ac05a8c4d2 Lucas Stach 2021-10-02  36  	int num_clks;
2684ac05a8c4d2 Lucas Stach 2021-10-02  37  	const char *gpc_name;
2684ac05a8c4d2 Lucas Stach 2021-10-02  38  	u32 rst_mask;
2684ac05a8c4d2 Lucas Stach 2021-10-02  39  	u32 clk_mask;
042b67799e2991 Adam Ford   2021-11-28  40  
042b67799e2991 Adam Ford   2021-11-28  41  	/*
042b67799e2991 Adam Ford   2021-11-28  42  	 * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register
042b67799e2991 Adam Ford   2021-11-28  43  	 * which is used to control the reset for the MIPI Phy.
042b67799e2991 Adam Ford   2021-11-28  44  	 * Since it's only present in certain circumstances,
042b67799e2991 Adam Ford   2021-11-28  45  	 * an if-statement should be used before setting and clearing this
042b67799e2991 Adam Ford   2021-11-28  46  	 * register.
042b67799e2991 Adam Ford   2021-11-28  47  	 */
042b67799e2991 Adam Ford   2021-11-28  48  	u32 mipi_phy_rst_mask;
2684ac05a8c4d2 Lucas Stach 2021-10-02  49  };
2684ac05a8c4d2 Lucas Stach 2021-10-02  50  

:::::: The code at line 33 was first introduced by commit
:::::: 2684ac05a8c4d2d5c49e6c11eb6206b30a284813 soc: imx: add i.MX8M blk-ctrl driver

:::::: TO: Lucas Stach <l.stach@pengutronix.de>
:::::: CC: Shawn Guo <shawnguo@kernel.org>

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

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

end of thread, other threads:[~2022-04-10 20:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-27 23:13 drivers/soc/imx/imx8m-blk-ctrl.c:33:8: warning: Excessive padding in 'struct imx8m_blk_ctrl_domain_data' (8 padding bytes, where 0 is optimal) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-02-02 18:56 kernel test robot
2022-02-06  1:48 kernel test robot
2022-03-21  6:36 kernel test robot
2022-04-10 20:29 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.