public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] scsi: lpfc: Reinstate lpfc_soft_wwn parameter
@ 2017-01-12 21:08 Dan Carpenter
  2017-01-17 19:09 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-01-12 21:08 UTC (permalink / raw)
  To: jsmart2021; +Cc: linux-scsi

Hello James Smart,

The patch 352e5fd10598: "scsi: lpfc: Reinstate lpfc_soft_wwn
parameter" from Dec 30, 2016, leads to the following static checker
warning:

	drivers/scsi/lpfc/lpfc_attr.c:2156 lpfc_soft_wwpn_store()
	info: return a literal instead of 'rc'

drivers/scsi/lpfc/lpfc_attr.c
  2146          if (!phba->soft_wwn_enable)
  2147                  return -EINVAL;
  2148  
  2149          /* lock setting wwpn, wwnn down */
  2150          phba->soft_wwn_enable = 0;
  2151  
  2152          rc = lpfc_wwn_set(buf, cnt, wwpn);
  2153          if (!rc) {
  2154                  /* not able to set wwpn, unlock it */
  2155                  phba->soft_wwn_enable = 1;
  2156                  return rc;

lpfc_wwn_set() returns zero when we are able to set wwpn so, from the
comment, i suspect that the if statement is reversed.  There was a
similar thing in lpfc_soft_wwnn_store() as well.

  2157          }
  2158  
  2159          phba->cfg_soft_wwpn = wwn_to_u64(wwpn);
  2160          fc_host_port_name(shost) = phba->cfg_soft_wwpn;
  2161          if (phba->cfg_soft_wwnn)
  2162                  fc_host_node_name(shost) = phba->cfg_soft_wwnn;
  2163  
  2164          dev_printk(KERN_NOTICE, &phba->pcidev->dev,
  2165                     "lpfc%d: Reinitializing to use soft_wwpn\n", phba->brd_no);
  2166  

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-17 19:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 21:08 [bug report] scsi: lpfc: Reinstate lpfc_soft_wwn parameter Dan Carpenter
2017-01-17 19:09 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox