public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Shyam Sundar <ssundar@marvell.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Himanshu Madhani <himanshu.madhani@oracle.com>,
	James Smart <james.smart@broadcom.com>,
	Nilesh Javali <njavali@marvell.com>
Subject: drivers/scsi/scsi_transport_fc.c:908:6: warning: variable 'desc_cnt' set but not used
Date: Fri, 25 Mar 2022 00:45:41 +0800	[thread overview]
Message-ID: <202203250040.RHMqwHeT-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ed4643521e6af8ab8ed1e467630a85884d2696cf
commit: 3dcfe0de5a9752e646a61f4ce513ac059960c7c3 scsi: fc: Parse FPIN packets and update statistics
date:   1 year, 5 months ago
config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220325/202203250040.RHMqwHeT-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
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=3dcfe0de5a9752e646a61f4ce513ac059960c7c3
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 3dcfe0de5a9752e646a61f4ce513ac059960c7c3
        # 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=i386 SHELL=/bin/bash drivers/scsi/

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/scsi_transport_fc.c:908:6: warning: variable 'desc_cnt' set but not used [-Wunused-but-set-variable]
           u32 desc_cnt = 0, bytes_remain;
               ^
   1 warning generated.


vim +/desc_cnt +908 drivers/scsi/scsi_transport_fc.c

   893	
   894	/**
   895	 * fc_host_rcv_fpin - routine to process a received FPIN.
   896	 * @shost:		host the FPIN was received on
   897	 * @fpin_len:		length of FPIN payload, in bytes
   898	 * @fpin_buf:		pointer to FPIN payload
   899	 *
   900	 * Notes:
   901	 *	This routine assumes no locks are held on entry.
   902	 */
   903	void
   904	fc_host_fpin_rcv(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf)
   905	{
   906		struct fc_els_fpin *fpin = (struct fc_els_fpin *)fpin_buf;
   907		struct fc_tlv_desc *tlv;
 > 908		u32 desc_cnt = 0, bytes_remain;
   909		u32 dtag;
   910	
   911		/* Update Statistics */
   912		tlv = (struct fc_tlv_desc *)&fpin->fpin_desc[0];
   913		bytes_remain = fpin_len - offsetof(struct fc_els_fpin, fpin_desc);
   914		bytes_remain = min_t(u32, bytes_remain, be32_to_cpu(fpin->desc_len));
   915	
   916		while (bytes_remain >= FC_TLV_DESC_HDR_SZ &&
   917		       bytes_remain >= FC_TLV_DESC_SZ_FROM_LENGTH(tlv)) {
   918			dtag = be32_to_cpu(tlv->desc_tag);
   919			switch (dtag) {
   920			case ELS_DTAG_LNK_INTEGRITY:
   921				fc_fpin_li_stats_update(shost, tlv);
   922				break;
   923			case ELS_DTAG_DELIVERY:
   924				fc_fpin_delivery_stats_update(shost, tlv);
   925				break;
   926			case ELS_DTAG_PEER_CONGEST:
   927				fc_fpin_peer_congn_stats_update(shost, tlv);
   928				break;
   929			case ELS_DTAG_CONGESTION:
   930				fc_fpin_congn_stats_update(shost, tlv);
   931			}
   932	
   933			desc_cnt++;
   934			bytes_remain -= FC_TLV_DESC_SZ_FROM_LENGTH(tlv);
   935			tlv = fc_tlv_next_desc(tlv);
   936		}
   937	
   938		fc_host_post_fc_event(shost, fc_get_event_number(),
   939					FCH_EVT_LINK_FPIN, fpin_len, fpin_buf, 0);
   940	}
   941	EXPORT_SYMBOL(fc_host_fpin_rcv);
   942	
   943	

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

                 reply	other threads:[~2022-03-24 16:46 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=202203250040.RHMqwHeT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=himanshu.madhani@oracle.com \
    --cc=james.smart@broadcom.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=martin.petersen@oracle.com \
    --cc=njavali@marvell.com \
    --cc=ssundar@marvell.com \
    /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