All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [bvanassche:ufs-for-next 16/17] drivers/scsi/ufs/ufshcd.c:1086:3: warning: variable 'pending' is uninitialized when used here
Date: Fri, 3 Dec 2021 07:40:17 +0800	[thread overview]
Message-ID: <202112030740.2OWuHbfI-lkp@intel.com> (raw)

tree:   https://github.com/bvanassche/linux ufs-for-next
head:   a4bec7f1327808f88f380bcfc67a0bf56ecc343f
commit: 07dc2a50633fbd851626e61b6b214890bd411050 [16/17] scsi: ufs: Optimize the command queueing code
config: hexagon-randconfig-r006-20211202 (https://download.01.org/0day-ci/archive/20211203/202112030740.2OWuHbfI-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4b553297ef3ee4dc2119d5429adf3072e90fac38)
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://github.com/bvanassche/linux/commit/07dc2a50633fbd851626e61b6b214890bd411050
        git remote add bvanassche https://github.com/bvanassche/linux
        git fetch --no-tags bvanassche ufs-for-next
        git checkout 07dc2a50633fbd851626e61b6b214890bd411050
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/scsi/ufs/

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

All warnings (new ones prefixed by >>):

>> drivers/scsi/ufs/ufshcd.c:1086:3: warning: variable 'pending' is uninitialized when used here [-Wuninitialized]
                   pending += sbitmap_weight(&sdev->budget_map);
                   ^~~~~~~
   drivers/scsi/ufs/ufshcd.c:1083:13: note: initialize the variable 'pending' to silence this warning
           u32 pending;
                      ^
                       = 0
   1 warning generated.


vim +/pending +1086 drivers/scsi/ufs/ufshcd.c

  1072	
  1073	/*
  1074	 * Determine the number of pending commands by counting the bits in the SCSI
  1075	 * device budget maps. This approach has been selected because a bit is set in
  1076	 * the budget map before scsi_host_queue_ready() checks the host_self_blocked
  1077	 * flag. The host_self_blocked flag can be modified by calling
  1078	 * scsi_block_requests() or scsi_unblock_requests().
  1079	 */
  1080	static u32 ufshcd_pending_cmds(struct ufs_hba *hba)
  1081	{
  1082		struct scsi_device *sdev;
  1083		u32 pending;
  1084	
  1085		shost_for_each_device(sdev, hba->host)
> 1086			pending += sbitmap_weight(&sdev->budget_map);
  1087	
  1088		return pending;
  1089	}
  1090	

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [bvanassche:ufs-for-next 16/17] drivers/scsi/ufs/ufshcd.c:1086:3: warning: variable 'pending' is uninitialized when used here
Date: Fri, 03 Dec 2021 07:40:17 +0800	[thread overview]
Message-ID: <202112030740.2OWuHbfI-lkp@intel.com> (raw)

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

tree:   https://github.com/bvanassche/linux ufs-for-next
head:   a4bec7f1327808f88f380bcfc67a0bf56ecc343f
commit: 07dc2a50633fbd851626e61b6b214890bd411050 [16/17] scsi: ufs: Optimize the command queueing code
config: hexagon-randconfig-r006-20211202 (https://download.01.org/0day-ci/archive/20211203/202112030740.2OWuHbfI-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4b553297ef3ee4dc2119d5429adf3072e90fac38)
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://github.com/bvanassche/linux/commit/07dc2a50633fbd851626e61b6b214890bd411050
        git remote add bvanassche https://github.com/bvanassche/linux
        git fetch --no-tags bvanassche ufs-for-next
        git checkout 07dc2a50633fbd851626e61b6b214890bd411050
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/scsi/ufs/

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

All warnings (new ones prefixed by >>):

>> drivers/scsi/ufs/ufshcd.c:1086:3: warning: variable 'pending' is uninitialized when used here [-Wuninitialized]
                   pending += sbitmap_weight(&sdev->budget_map);
                   ^~~~~~~
   drivers/scsi/ufs/ufshcd.c:1083:13: note: initialize the variable 'pending' to silence this warning
           u32 pending;
                      ^
                       = 0
   1 warning generated.


vim +/pending +1086 drivers/scsi/ufs/ufshcd.c

  1072	
  1073	/*
  1074	 * Determine the number of pending commands by counting the bits in the SCSI
  1075	 * device budget maps. This approach has been selected because a bit is set in
  1076	 * the budget map before scsi_host_queue_ready() checks the host_self_blocked
  1077	 * flag. The host_self_blocked flag can be modified by calling
  1078	 * scsi_block_requests() or scsi_unblock_requests().
  1079	 */
  1080	static u32 ufshcd_pending_cmds(struct ufs_hba *hba)
  1081	{
  1082		struct scsi_device *sdev;
  1083		u32 pending;
  1084	
  1085		shost_for_each_device(sdev, hba->host)
> 1086			pending += sbitmap_weight(&sdev->budget_map);
  1087	
  1088		return pending;
  1089	}
  1090	

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

             reply	other threads:[~2021-12-02 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 23:40 kernel test robot [this message]
2021-12-02 23:40 ` [bvanassche:ufs-for-next 16/17] drivers/scsi/ufs/ufshcd.c:1086:3: warning: variable 'pending' is uninitialized when used here 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=202112030740.2OWuHbfI-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bvanassche@acm.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /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.