All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c:185:3: warning: Value stored to 'r' is never read [clang-analyzer-deadcode.DeadStores]
Date: Tue, 25 Jan 2022 06:23:19 +0800	[thread overview]
Message-ID: <202201250426.AeGyiHMY-lkp@intel.com> (raw)

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: James Yao <yiqing.yao@amd.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Jingwen Chen <Jingwen.Chen2@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 216a9873198bdc5c670a9f71d58fafd30227c9c8 drm/amdgpu: add dummy event6 for vega10
date:   2 weeks ago
:::::: branch date: 29 hours ago
:::::: commit date: 2 weeks ago
config: riscv-randconfig-c006-20220124 (https://download.01.org/0day-ci/archive/20220125/202201250426.AeGyiHMY-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9006bf424847bf91f0a624ffc27ad165c7b804c4)
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=216a9873198bdc5c670a9f71d58fafd30227c9c8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 216a9873198bdc5c670a9f71d58fafd30227c9c8
        # 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 >>)
                             ^
   mm/vmalloc.c:1824:27: note: expanded from macro 'VMAP_BLOCK_SIZE'
   #define VMAP_BLOCK_SIZE         (VMAP_BBMAP_BITS * PAGE_SIZE)
                                    ^
   mm/vmalloc.c:1822:20: note: expanded from macro 'VMAP_BBMAP_BITS'
                           VMALLOC_PAGES / roundup_pow_of_two(NR_CPUS) / 16))
                                           ^
   include/linux/log2.h:178:12: note: expanded from macro 'roundup_pow_of_two'
                   (1UL << (ilog2((n) - 1) + 1))   \
                            ^
   include/linux/log2.h:158:2: note: expanded from macro 'ilog2'
           __builtin_constant_p(n) ?       \
           ^
   mm/vmalloc.c:2053:20: note: '?' condition is false
           offset = (addr & (VMAP_BLOCK_SIZE - 1)) >> PAGE_SHIFT;
                             ^
   mm/vmalloc.c:1824:27: note: expanded from macro 'VMAP_BLOCK_SIZE'
   #define VMAP_BLOCK_SIZE         (VMAP_BBMAP_BITS * PAGE_SIZE)
                                    ^
   mm/vmalloc.c:1822:20: note: expanded from macro 'VMAP_BBMAP_BITS'
                           VMALLOC_PAGES / roundup_pow_of_two(NR_CPUS) / 16))
                                           ^
   include/linux/log2.h:178:12: note: expanded from macro 'roundup_pow_of_two'
                   (1UL << (ilog2((n) - 1) + 1))   \
                            ^
   include/linux/log2.h:159:3: note: expanded from macro 'ilog2'
           ((n) < 2 ? 0 :                  \
            ^
   mm/vmalloc.c:2053:20: note: Assuming the condition is true
           offset = (addr & (VMAP_BLOCK_SIZE - 1)) >> PAGE_SHIFT;
                             ^
   mm/vmalloc.c:1824:27: note: expanded from macro 'VMAP_BLOCK_SIZE'
   #define VMAP_BLOCK_SIZE         (VMAP_BBMAP_BITS * PAGE_SIZE)
                                    ^~~~~~~~~~~~~~~
   mm/vmalloc.c:1820:3: note: expanded from macro 'VMAP_BBMAP_BITS'
                   VMAP_MIN(VMAP_BBMAP_BITS_MAX,   \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmalloc.c:1817:26: note: expanded from macro 'VMAP_MIN'
   #define VMAP_MIN(x, y)          ((x) < (y) ? (x) : (y)) /* can't use min() */
                                    ^~~~~~~~~
   mm/vmalloc.c:2053:20: note: '?' condition is true
           offset = (addr & (VMAP_BLOCK_SIZE - 1)) >> PAGE_SHIFT;
                             ^
   mm/vmalloc.c:1824:27: note: expanded from macro 'VMAP_BLOCK_SIZE'
   #define VMAP_BLOCK_SIZE         (VMAP_BBMAP_BITS * PAGE_SIZE)
                                    ^
   mm/vmalloc.c:1820:3: note: expanded from macro 'VMAP_BBMAP_BITS'
                   VMAP_MIN(VMAP_BBMAP_BITS_MAX,   \
                   ^
   mm/vmalloc.c:1817:26: note: expanded from macro 'VMAP_MIN'
   #define VMAP_MIN(x, y)          ((x) < (y) ? (x) : (y)) /* can't use min() */
                                    ^
   mm/vmalloc.c:2058:2: note: Taking false branch
           if (debug_pagealloc_enabled_static())
           ^
   mm/vmalloc.c:2064:18: note: Assuming '__UNIQUE_ID___x284' is >= '__UNIQUE_ID___y285'
           vb->dirty_min = min(vb->dirty_min, offset);
                           ^
   include/linux/minmax.h:45:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^~~~~~~~~~
   mm/vmalloc.c:2064:18: note: '?' condition is false
           vb->dirty_min = min(vb->dirty_min, offset);
                           ^
   include/linux/minmax.h:45:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^
   include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                   ^
   include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
                   __cmp(unique_x, unique_y, op); })
                   ^
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   mm/vmalloc.c:2065:51: note: The result of the left shift is undefined due to shifting by '64', which is greater or equal to the width of type 'unsigned long'
           vb->dirty_max = max(vb->dirty_max, offset + (1UL << order));
                                                            ^
   include/linux/minmax.h:52:36: note: expanded from macro 'max'
   #define max(x, y)       __careful_cmp(x, y, >)
                                            ^
   include/linux/minmax.h:38:17: note: expanded from macro '__careful_cmp'
                   __cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
                                 ^
   include/linux/minmax.h:32:25: note: expanded from macro '__cmp_once'
                   typeof(y) unique_y = (y);               \
                                         ^
   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.
   12 warnings generated.
>> drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c:185:3: warning: Value stored to 'r' is never read [clang-analyzer-deadcode.DeadStores]
                   r = xgpu_ai_poll_msg(adev, IDH_REQ_GPU_INIT_DATA_READY);
                   ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c:185:3: note: Value stored to 'r' is never read
                   r = xgpu_ai_poll_msg(adev, IDH_REQ_GPU_INIT_DATA_READY);
                   ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   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.
   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.
   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.
   7 warnings generated.
   fs/ntfs3/xattr.c:966:3: warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                   i_uid_write(inode, (uid_t)le32_to_cpu(value[0]));
                   ^                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/xattr.c:960:6: note: Calling 'ntfs_get_ea'
           if (ntfs_get_ea(inode, "$LXUID", sizeof("$LXUID") - 1, &value[0],
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/xattr.c:209:6: note: Assuming the condition is false
           if (!(ni->ni_flags & NI_FLAG_EA))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/xattr.c:209:2: note: Taking false branch
           if (!(ni->ni_flags & NI_FLAG_EA))
           ^
   fs/ntfs3/xattr.c:212:7: note: 'required' is non-null
           if (!required)
                ^~~~~~~~
   fs/ntfs3/xattr.c:212:2: note: Taking false branch
           if (!required)
           ^
   fs/ntfs3/xattr.c:217:6: note: 'name_len' is <= 255
           if (name_len > 255) {
               ^~~~~~~~
   fs/ntfs3/xattr.c:217:2: note: Taking false branch
           if (name_len > 255) {
           ^
   fs/ntfs3/xattr.c:223:6: note: 'err' is not equal to 0
           if (err)
               ^~~
   fs/ntfs3/xattr.c:223:2: note: Taking true branch
           if (err)
           ^
   fs/ntfs3/xattr.c:224:3: note: Control jumps to line 253
                   goto out;
                   ^
   fs/ntfs3/xattr.c:254:7: note: 'required' is non-null
           if (!required)
                ^~~~~~~~
   fs/ntfs3/xattr.c:254:2: note: Taking false branch
           if (!required)
           ^
   fs/ntfs3/xattr.c:257:9: note: 'err' is not equal to 0
           return err ? err : len;
                  ^~~
   fs/ntfs3/xattr.c:257:9: note: '?' condition is true
   fs/ntfs3/xattr.c:257:2: note: Returning without writing to '*buffer'
           return err ? err : len;
           ^
   fs/ntfs3/xattr.c:960:6: note: Returning from 'ntfs_get_ea'
           if (ntfs_get_ea(inode, "$LXUID", sizeof("$LXUID") - 1, &value[0],
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/xattr.c:960:6: note: Assuming the condition is true
           if (ntfs_get_ea(inode, "$LXUID", sizeof("$LXUID") - 1, &value[0],
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs3/xattr.c:960:6: note: Left side of '&&' is true

vim +/r +185 drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c

890419409a3aba Gavin Wan     2017-06-23  160  
890419409a3aba Gavin Wan     2017-06-23  161  static int xgpu_ai_send_access_requests(struct amdgpu_device *adev,
890419409a3aba Gavin Wan     2017-06-23  162  					enum idh_request req)
890419409a3aba Gavin Wan     2017-06-23  163  {
890419409a3aba Gavin Wan     2017-06-23  164  	int r;
890419409a3aba Gavin Wan     2017-06-23  165  
890419409a3aba Gavin Wan     2017-06-23  166  	xgpu_ai_mailbox_trans_msg(adev, req, 0, 0, 0);
c9c9de93a33ccd Xiangliang Yu 2017-03-10  167  
c9c9de93a33ccd Xiangliang Yu 2017-03-10  168  	/* start to check msg if request is idh_req_gpu_init_access */
c9c9de93a33ccd Xiangliang Yu 2017-03-10  169  	if (req == IDH_REQ_GPU_INIT_ACCESS ||
c9c9de93a33ccd Xiangliang Yu 2017-03-10  170  		req == IDH_REQ_GPU_FINI_ACCESS ||
c9c9de93a33ccd Xiangliang Yu 2017-03-10  171  		req == IDH_REQ_GPU_RESET_ACCESS) {
94b4fd725b7d86 Monk Liu      2017-04-05  172  		r = xgpu_ai_poll_msg(adev, IDH_READY_TO_ACCESS_GPU);
17b2e332a277bf Monk Liu      2017-04-21  173  		if (r) {
17b2e332a277bf Monk Liu      2017-04-21  174  			pr_err("Doesn't get READY_TO_ACCESS_GPU from pf, give up\n");
c9c9de93a33ccd Xiangliang Yu 2017-03-10  175  			return r;
c9c9de93a33ccd Xiangliang Yu 2017-03-10  176  		}
2dc8f81e4f822c Horace Chen   2017-10-09  177  		/* Retrieve checksum from mailbox2 */
d3c117e564bfbf Emily Deng    2018-12-29  178  		if (req == IDH_REQ_GPU_INIT_ACCESS || req == IDH_REQ_GPU_RESET_ACCESS) {
2dc8f81e4f822c Horace Chen   2017-10-09  179  			adev->virt.fw_reserve.checksum_key =
2dc8f81e4f822c Horace Chen   2017-10-09  180  				RREG32_NO_KIQ(SOC15_REG_OFFSET(NBIO, 0,
2dc8f81e4f822c Horace Chen   2017-10-09  181  					mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW2));
2dc8f81e4f822c Horace Chen   2017-10-09  182  		}
216a9873198bdc James Yao     2021-12-29  183  	} else if (req == IDH_REQ_GPU_INIT_DATA){
216a9873198bdc James Yao     2021-12-29  184  		/* Dummy REQ_GPU_INIT_DATA handling */
216a9873198bdc James Yao     2021-12-29 @185  		r = xgpu_ai_poll_msg(adev, IDH_REQ_GPU_INIT_DATA_READY);
216a9873198bdc James Yao     2021-12-29  186  		/* version set to 0 since dummy */
216a9873198bdc James Yao     2021-12-29  187  		adev->virt.req_init_data_ver = 0;	
17b2e332a277bf Monk Liu      2017-04-21  188  	}
c9c9de93a33ccd Xiangliang Yu 2017-03-10  189  
c9c9de93a33ccd Xiangliang Yu 2017-03-10  190  	return 0;
c9c9de93a33ccd Xiangliang Yu 2017-03-10  191  }
c9c9de93a33ccd Xiangliang Yu 2017-03-10  192  

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

                 reply	other threads:[~2022-01-24 22:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202201250426.AeGyiHMY-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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 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.