linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: unlisted-recipients:; (no To-header on input)
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, Maxime Ripard <maxime@cerno.tech>
Subject: drivers/gpu/drm/bridge/analogix/anx7625.c:754:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
Date: Wed, 18 Aug 2021 18:31:59 +0800	[thread overview]
Message-ID: <202108181841.GDwrpLCT-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   614cb2751d3150850d459bee596c397f344a7936
commit: c489573b5b6ce6442ad4658d9d5ec77839b91622 Merge drm/drm-next into drm-misc-next
date:   10 months ago
config: x86_64-randconfig-c001-20210813 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 767496d19cb9a1fbba57ff08095faa161998ee36)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c489573b5b6ce6442ad4658d9d5ec77839b91622
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout c489573b5b6ce6442ad4658d9d5ec77839b91622
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 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 >>)
           ^     ~
   net/9p/client.c:2093:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2153:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2153:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2184:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2184:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2214:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2214:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2247:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2247:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   net/9p/client.c:2281:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = 0;
           ^     ~
   net/9p/client.c:2281:2: note: Value stored to 'err' is never read
           err = 0;
           ^     ~
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   fs/jffs2/nodelist.c:600:9: warning: Access to field 'flash_offset' results in a dereference of a null pointer (loaded from variable 'ref') [clang-analyzer-core.NullDereference]
           while (ref->flash_offset != REF_EMPTY_NODE) {
                  ^
   fs/jffs2/nodelist.c:665:6: note: Assuming 'size' is not equal to 0
           if (!size)
               ^~~~~
   fs/jffs2/nodelist.c:665:2: note: Taking false branch
           if (!size)
           ^
   fs/jffs2/nodelist.c:667:15: note: Assuming 'size' is <= field 'free_size'
           if (unlikely(size > jeb->free_size)) {
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   fs/jffs2/nodelist.c:667:2: note: Taking false branch
           if (unlikely(size > jeb->free_size)) {
           ^
   fs/jffs2/nodelist.c:673:6: note: Assuming field 'last_node' is null
           if (jeb->last_node && ref_obsolete(jeb->last_node)) {
               ^~~~~~~~~~~~~~
   fs/jffs2/nodelist.c:673:21: note: Left side of '&&' is false
           if (jeb->last_node && ref_obsolete(jeb->last_node)) {
                              ^
   fs/jffs2/nodelist.c:685:3: note: Calling 'jffs2_link_node_ref'
                   jffs2_link_node_ref(c, jeb, ofs, size, NULL);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/jffs2/nodelist.c:592:9: note: Assuming field 'allocated_refs' is not equal to 0
           BUG_ON(!jeb->allocated_refs);
                  ^
   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)
                                               ^
   fs/jffs2/nodelist.c:592:2: note: Taking false branch
           BUG_ON(!jeb->allocated_refs);
           ^
   include/asm-generic/bug.h:63:32: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                  ^
   fs/jffs2/nodelist.c:592:2: note: Loop condition is false.  Exiting loop
           BUG_ON(!jeb->allocated_refs);
           ^
   include/asm-generic/bug.h:63:27: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                             ^
   fs/jffs2/nodelist.c:595:2: note: Null pointer value stored to 'ref'
           ref = jeb->last_node;
           ^~~~~~~~~~~~~~~~~~~~
   fs/jffs2/nodelist.c:600:9: note: Access to field 'flash_offset' results in a dereference of a null pointer (loaded from variable 'ref')
           while (ref->flash_offset != REF_EMPTY_NODE) {
                  ^~~
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
>> drivers/gpu/drm/bridge/analogix/anx7625.c:754:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                           ret = sp_tx_rst_aux(ctx);
                           ^     ~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/analogix/anx7625.c:754:4: note: Value stored to 'ret' is never read
                           ret = sp_tx_rst_aux(ctx);
                           ^     ~~~~~~~~~~~~~~~~~~
   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.
   drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:536:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
           err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2],
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:536:2: note: Value stored to 'err' is never read
           err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2],
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c:424:2: warning: Value stored to 'reg' is never read [clang-analyzer-deadcode.DeadStores]
           reg = readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
           ^
   drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c:424:2: note: Value stored to 'reg' is never read
   Suppressed 7 warnings (6 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.
   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.
   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.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   11 warnings generated.
   Suppressed 11 warnings (11 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   drivers/iio/magnetometer/hmc5843_core.c:127:8: warning: Excessive padding in 'struct hmc5843_chip_info' (8 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   channels, 
   regval_to_samp_freq, 
   regval_to_nanoscale, 
   n_regval_to_samp_freq, 
   n_regval_to_nanoscale, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct hmc5843_chip_info {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/iio/magnetometer/hmc5843_core.c:127:8: note: Excessive padding in 'struct hmc5843_chip_info' (8 padding bytes, where 0 is optimal). Optimal fields order: channels, regval_to_samp_freq, regval_to_nanoscale, n_regval_to_samp_freq, n_regval_to_nanoscale, consider reordering the fields or adding explicit padding members
   struct hmc5843_chip_info {
   ~~~~~~~^~~~~~~~~~~~~~~~~~~
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   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.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   7 warnings generated.
   drivers/iio/potentiometer/mcp41010.c:58:8: warning: Excessive padding in 'struct mcp41010_data' (86 padding bytes, where 22 is optimal). 
   Optimal fields order: 
   buf, 
   value, 
   spi, 
   cfg, 
   lock, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct mcp41010_data {
   ~~~~~~~^~~~~~~~~~~~~~~
   drivers/iio/potentiometer/mcp41010.c:58:8: note: Excessive padding in 'struct mcp41010_data' (86 padding bytes, where 22 is optimal). Optimal fields order: buf, value, spi, cfg, lock, consider reordering the fields or adding explicit padding members
   struct mcp41010_data {
   ~~~~~~~^~~~~~~~~~~~~~~
   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.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   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.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

vim +/ret +754 drivers/gpu/drm/bridge/analogix/anx7625.c

8bdfc5dae4e3ba Xin Ji 2020-09-18  720  
8bdfc5dae4e3ba Xin Ji 2020-09-18  721  static int segments_edid_read(struct anx7625_data *ctx,
8bdfc5dae4e3ba Xin Ji 2020-09-18  722  			      u8 segment, u8 *buf, u8 offset)
8bdfc5dae4e3ba Xin Ji 2020-09-18  723  {
8bdfc5dae4e3ba Xin Ji 2020-09-18  724  	u8 cnt;
8bdfc5dae4e3ba Xin Ji 2020-09-18  725  	int ret;
8bdfc5dae4e3ba Xin Ji 2020-09-18  726  	struct device *dev = &ctx->client->dev;
8bdfc5dae4e3ba Xin Ji 2020-09-18  727  
8bdfc5dae4e3ba Xin Ji 2020-09-18  728  	/* Write address only */
8bdfc5dae4e3ba Xin Ji 2020-09-18  729  	ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  730  				AP_AUX_ADDR_7_0, 0x30);
8bdfc5dae4e3ba Xin Ji 2020-09-18  731  	ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  732  				 AP_AUX_COMMAND, 0x04);
8bdfc5dae4e3ba Xin Ji 2020-09-18  733  	ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  734  				 AP_AUX_CTRL_STATUS,
8bdfc5dae4e3ba Xin Ji 2020-09-18  735  				 AP_AUX_CTRL_ADDRONLY | AP_AUX_CTRL_OP_EN);
8bdfc5dae4e3ba Xin Ji 2020-09-18  736  
8bdfc5dae4e3ba Xin Ji 2020-09-18  737  	ret |= wait_aux_op_finish(ctx);
8bdfc5dae4e3ba Xin Ji 2020-09-18  738  	/* Write segment address */
8bdfc5dae4e3ba Xin Ji 2020-09-18  739  	ret |= sp_tx_aux_wr(ctx, segment);
8bdfc5dae4e3ba Xin Ji 2020-09-18  740  	/* Data read */
8bdfc5dae4e3ba Xin Ji 2020-09-18  741  	ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  742  				 AP_AUX_ADDR_7_0, 0x50);
8bdfc5dae4e3ba Xin Ji 2020-09-18  743  	if (ret) {
8bdfc5dae4e3ba Xin Ji 2020-09-18  744  		DRM_DEV_ERROR(dev, "IO error : aux initial fail.\n");
8bdfc5dae4e3ba Xin Ji 2020-09-18  745  		return ret;
8bdfc5dae4e3ba Xin Ji 2020-09-18  746  	}
8bdfc5dae4e3ba Xin Ji 2020-09-18  747  
8bdfc5dae4e3ba Xin Ji 2020-09-18  748  	for (cnt = 0; cnt <= EDID_TRY_CNT; cnt++) {
8bdfc5dae4e3ba Xin Ji 2020-09-18  749  		sp_tx_aux_wr(ctx, offset);
8bdfc5dae4e3ba Xin Ji 2020-09-18  750  		/* Set I2C read com 0x01 mot = 0 and read 16 bytes */
8bdfc5dae4e3ba Xin Ji 2020-09-18  751  		ret = sp_tx_aux_rd(ctx, 0xf1);
8bdfc5dae4e3ba Xin Ji 2020-09-18  752  
8bdfc5dae4e3ba Xin Ji 2020-09-18  753  		if (ret) {
8bdfc5dae4e3ba Xin Ji 2020-09-18 @754  			ret = sp_tx_rst_aux(ctx);
8bdfc5dae4e3ba Xin Ji 2020-09-18  755  			DRM_DEV_ERROR(dev, "segment read fail, reset!\n");
8bdfc5dae4e3ba Xin Ji 2020-09-18  756  		} else {
8bdfc5dae4e3ba Xin Ji 2020-09-18  757  			ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client,
8bdfc5dae4e3ba Xin Ji 2020-09-18  758  						     AP_AUX_BUFF_START,
8bdfc5dae4e3ba Xin Ji 2020-09-18  759  						     MAX_DPCD_BUFFER_SIZE, buf);
8bdfc5dae4e3ba Xin Ji 2020-09-18  760  			if (ret > 0)
8bdfc5dae4e3ba Xin Ji 2020-09-18  761  				break;
8bdfc5dae4e3ba Xin Ji 2020-09-18  762  		}
8bdfc5dae4e3ba Xin Ji 2020-09-18  763  	}
8bdfc5dae4e3ba Xin Ji 2020-09-18  764  
8bdfc5dae4e3ba Xin Ji 2020-09-18  765  	if (cnt > EDID_TRY_CNT)
8bdfc5dae4e3ba Xin Ji 2020-09-18  766  		return -EIO;
8bdfc5dae4e3ba Xin Ji 2020-09-18  767  
8bdfc5dae4e3ba Xin Ji 2020-09-18  768  	return 0;
8bdfc5dae4e3ba Xin Ji 2020-09-18  769  }
8bdfc5dae4e3ba Xin Ji 2020-09-18  770  

:::::: The code at line 754 was first introduced by commit
:::::: 8bdfc5dae4e3ba4d99dfb430ef43249e5f1b7730 drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP

:::::: TO: Xin Ji <xji@analogixsemi.com>
:::::: CC: Sam Ravnborg <sam@ravnborg.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36569 bytes --]

             reply	other threads:[~2021-08-18 10:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 10:31 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-08-15 14:29 drivers/gpu/drm/bridge/analogix/anx7625.c:754:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202108181841.GDwrpLCT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime@cerno.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).