public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: jsmart2021@gmail.com
Cc: linux-scsi@vger.kernel.org
Subject: [bug report] scsi: lpfc: Reinstate lpfc_soft_wwn parameter
Date: Fri, 13 Jan 2017 00:08:04 +0300	[thread overview]
Message-ID: <20170112210804.GA19275@mwanda> (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

             reply	other threads:[~2017-01-12 21:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 21:08 Dan Carpenter [this message]
2017-01-17 19:09 ` [bug report] scsi: lpfc: Reinstate lpfc_soft_wwn parameter Martin K. Petersen

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=20170112210804.GA19275@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    /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