[linux-next:master 5940/7024] drivers/scsi/lpfc/lpfc_hbadisc.c:249:21: warning: variable 'shost' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f8550c0d35df3d027724b250a8c5888dfb2fa749
commit: 52edb2caf675684acf2140a125de4774c691fecd [5940/7024] scsi: lpfc: Remove ndlp when a PLOGI/ADISC/PRLI/REG_RPI ultimately fails
config: i386-randconfig-a002-20201119 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=52edb2caf675684acf2140a125de4774c691fecd
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 52edb2caf675684acf2140a125de4774c691fecd
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_rport_invalid':
   drivers/scsi/lpfc/lpfc_hbadisc.c:87:21: warning: variable 'vport' set but not used [-Wunused-but-set-variable]
      87 |  struct lpfc_vport *vport;
         |                     ^~~~~
   drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_dev_loss_tmo_handler':
>> drivers/scsi/lpfc/lpfc_hbadisc.c:249:21: warning: variable 'shost' set but not used [-Wunused-but-set-variable]
     249 |  struct Scsi_Host  *shost;
         |                     ^~~~~
   drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_nlp_get':
   drivers/scsi/lpfc/lpfc_hbadisc.c:6204:19: warning: variable 'phba' set but not used [-Wunused-but-set-variable]
    6204 |  struct lpfc_hba *phba;
         |                   ^~~~

vim +/shost +249 drivers/scsi/lpfc/lpfc_hbadisc.c

858c9f6c19c6f9b James Smart            2007-06-17  233  
a93ff37a8a869c7 James Smart            2010-10-22  234  /**
a93ff37a8a869c7 James Smart            2010-10-22  235   * lpfc_dev_loss_tmo_handler - Remote node devloss timeout handler
a93ff37a8a869c7 James Smart            2010-10-22  236   * @ndlp: Pointer to remote node object.
a93ff37a8a869c7 James Smart            2010-10-22  237   *
a93ff37a8a869c7 James Smart            2010-10-22  238   * This function is called from the worker thread when devloss timeout timer
a93ff37a8a869c7 James Smart            2010-10-22  239   * expires. For SLI4 host, this routine shall return 1 when at lease one
a93ff37a8a869c7 James Smart            2010-10-22  240   * remote node, including this @ndlp, is still in use of FCF; otherwise, this
a93ff37a8a869c7 James Smart            2010-10-22  241   * routine shall return 0 when there is no remote node is still in use of FCF
a93ff37a8a869c7 James Smart            2010-10-22  242   * when devloss timeout happened to this @ndlp.
a93ff37a8a869c7 James Smart            2010-10-22  243   **/
a93ff37a8a869c7 James Smart            2010-10-22  244  static int
858c9f6c19c6f9b James Smart            2007-06-17  245  lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
858c9f6c19c6f9b James Smart            2007-06-17  246  {
858c9f6c19c6f9b James Smart            2007-06-17  247  	struct lpfc_vport *vport;
858c9f6c19c6f9b James Smart            2007-06-17  248  	struct lpfc_hba   *phba;
466e840b7809e00 James Smart            2015-05-21 @249  	struct Scsi_Host  *shost;
858c9f6c19c6f9b James Smart            2007-06-17  250  	uint8_t *name;
858c9f6c19c6f9b James Smart            2007-06-17  251  	int warn_on = 0;
a93ff37a8a869c7 James Smart            2010-10-22  252  	int fcf_inuse = 0;
894bb17f0cb07a6 James Smart            2019-08-14  253  	unsigned long iflags;
858c9f6c19c6f9b James Smart            2007-06-17  254  
466e840b7809e00 James Smart            2015-05-21  255  	vport = ndlp->vport;
466e840b7809e00 James Smart            2015-05-21  256  	shost = lpfc_shost_from_vport(vport);
858c9f6c19c6f9b James Smart            2007-06-17  257  	name = (uint8_t *)&ndlp->nlp_portname;
858c9f6c19c6f9b James Smart            2007-06-17  258  	phba = vport->phba;
858c9f6c19c6f9b James Smart            2007-06-17  259  
c6adba150191762 James Smart            2020-11-15  260  	spin_lock_irqsave(&ndlp->lock, iflags);
c6adba150191762 James Smart            2020-11-15  261  	ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
c6adba150191762 James Smart            2020-11-15  262  	spin_unlock_irqrestore(&ndlp->lock, iflags);
c6adba150191762 James Smart            2020-11-15  263  
a93ff37a8a869c7 James Smart            2010-10-22  264  	if (phba->sli_rev == LPFC_SLI_REV4)
a93ff37a8a869c7 James Smart            2010-10-22  265  		fcf_inuse = lpfc_fcf_inuse(phba);
a93ff37a8a869c7 James Smart            2010-10-22  266  
858c9f6c19c6f9b James Smart            2007-06-17  267  	lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT,
858c9f6c19c6f9b James Smart            2007-06-17  268  			      "rport devlosstmo:did:x%x type:x%x id:x%x",
c6adba150191762 James Smart            2020-11-15  269  			      ndlp->nlp_DID, ndlp->nlp_type, ndlp->nlp_sid);
858c9f6c19c6f9b James Smart            2007-06-17  270  
34f5ad8bddeda2a James Smart            2012-08-03  271  	lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE,
52edb2caf675684 James Smart            2020-11-15  272  			 "3182 %s x%06x, nflag x%x xflags x%x refcnt %d\n",
c6adba150191762 James Smart            2020-11-15  273  			 __func__, ndlp->nlp_DID, ndlp->nlp_flag,
52edb2caf675684 James Smart            2020-11-15  274  			 ndlp->fc4_xpt_flags, kref_read(&ndlp->kref));
a8adb83208020c9 James Smart            2007-10-27  275  
52edb2caf675684 James Smart            2020-11-15  276  	/* If the driver is recovering the rport, ignore devloss. */
d7c255b26d8e3f1 James Smart            2008-08-24  277  	if (ndlp->nlp_state == NLP_STE_MAPPED_NODE) {
d7c255b26d8e3f1 James Smart            2008-08-24  278  		lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
d7c255b26d8e3f1 James Smart            2008-08-24  279  				 "0284 Devloss timeout Ignored on "
d7c255b26d8e3f1 James Smart            2008-08-24  280  				 "WWPN %x:%x:%x:%x:%x:%x:%x:%x "
d7c255b26d8e3f1 James Smart            2008-08-24  281  				 "NPort x%x\n",
d7c255b26d8e3f1 James Smart            2008-08-24  282  				 *name, *(name+1), *(name+2), *(name+3),
d7c255b26d8e3f1 James Smart            2008-08-24  283  				 *(name+4), *(name+5), *(name+6), *(name+7),
d7c255b26d8e3f1 James Smart            2008-08-24  284  				 ndlp->nlp_DID);
a93ff37a8a869c7 James Smart            2010-10-22  285  		return fcf_inuse;
d7c255b26d8e3f1 James Smart            2008-08-24  286  	}
858c9f6c19c6f9b James Smart            2007-06-17  287  
52edb2caf675684 James Smart            2020-11-15  288  	/* Fabric nodes are done. */
52edb2caf675684 James Smart            2020-11-15  289  	if (ndlp->nlp_type & NLP_FABRIC) {
52edb2caf675684 James Smart            2020-11-15  290  		lpfc_nlp_put(ndlp);
a93ff37a8a869c7 James Smart            2010-10-22  291  		return fcf_inuse;
52edb2caf675684 James Smart            2020-11-15  292  	}
82085718faa6955 James Smart            2007-04-25  293  
dea3101e0a5c897 James Bottomley        2005-04-17  294  	if (ndlp->nlp_sid != NLP_NO_SID) {
6e8215e48865bda James.Smart@xxxxxxxxxx 2005-06-25  295  		warn_on = 1;
895427bd012ce58 James Smart            2017-02-12  296  		lpfc_sli_abort_iocb(vport, &phba->sli.sli3_ring[LPFC_FCP_RING],
51ef4c26891a734 James Smart            2007-08-02  297  				    ndlp->nlp_sid, 0, LPFC_CTX_TGT);
dea3101e0a5c897 James Bottomley        2005-04-17  298  	}
c01f32087960edd James Smart            2006-08-18  299  
6e8215e48865bda James.Smart@xxxxxxxxxx 2005-06-25  300  	if (warn_on) {
372c187b8a705c0 Dick Kennedy           2020-06-30  301  		lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
e8b62011d88d6fd James Smart            2007-08-02  302  				 "0203 Devloss timeout on "
58da1ffb2b1234e James Smart            2008-04-07  303  				 "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
58da1ffb2b1234e James Smart            2008-04-07  304  				 "NPort x%06x Data: x%x x%x x%x\n",
488d1469b318e6b James Smart            2006-03-07  305  				 *name, *(name+1), *(name+2), *(name+3),
488d1469b318e6b James Smart            2006-03-07  306  				 *(name+4), *(name+5), *(name+6), *(name+7),
488d1469b318e6b James Smart            2006-03-07  307  				 ndlp->nlp_DID, ndlp->nlp_flag,
6e8215e48865bda James.Smart@xxxxxxxxxx 2005-06-25  308  				 ndlp->nlp_state, ndlp->nlp_rpi);
6e8215e48865bda James.Smart@xxxxxxxxxx 2005-06-25  309  	} else {
372c187b8a705c0 Dick Kennedy           2020-06-30  310  		lpfc_printf_vlog(vport, KERN_INFO, LOG_TRACE_EVENT,
e8b62011d88d6fd James Smart            2007-08-02  311  				 "0204 Devloss timeout on "
58da1ffb2b1234e James Smart            2008-04-07  312  				 "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
58da1ffb2b1234e James Smart            2008-04-07  313  				 "NPort x%06x Data: x%x x%x x%x\n",
488d1469b318e6b James Smart            2006-03-07  314  				 *name, *(name+1), *(name+2), *(name+3),
488d1469b318e6b James Smart            2006-03-07  315  				 *(name+4), *(name+5), *(name+6), *(name+7),
488d1469b318e6b James Smart            2006-03-07  316  				 ndlp->nlp_DID, ndlp->nlp_flag,
6e8215e48865bda James.Smart@xxxxxxxxxx 2005-06-25  317  				 ndlp->nlp_state, ndlp->nlp_rpi);
6e8215e48865bda James.Smart@xxxxxxxxxx 2005-06-25  318  	}
6e8215e48865bda James.Smart@xxxxxxxxxx 2005-06-25  319  
52edb2caf675684 James Smart            2020-11-15  320  	if (!(ndlp->fc4_xpt_flags & NVME_XPT_REGD))
87af33fe5f78c27 James Smart            2007-10-27  321  		lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM);
6fb120a7ed882aa James Smart            2009-05-22  322  
a93ff37a8a869c7 James Smart            2010-10-22  323  	return fcf_inuse;
a93ff37a8a869c7 James Smart            2010-10-22  324  }
a93ff37a8a869c7 James Smart            2010-10-22  325  

:::::: The code at line 249 was first introduced by commit
:::::: 466e840b7809e00ab3a1af9b4a5b5751e681730d lpfc: Fix rport leak.

:::::: TO: James Smart <james.smart@xxxxxxxxxxxxx>
:::::: CC: James Bottomley <JBottomley@xxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux