Skip to contentSkip to conversation

scsi: lpfc: Reinstate lpfc_soft_wwn parameter

bug report Dan Carpenter 2 participants 2 messages Jan 12, 2017 – Jan 17, 2017 SCSI

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Dan" == Dan Carpenter <[email protected]> writes:

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

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

James?

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering