[PATCH v3 11/17] scsi:ibmvfc: Added changes to fc_remote_port_chkready

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

 



Added changes to pass a new argument to fc_remote_port_chkready

Also fixed the checkpatch error
"do not use assignment in if condition"

Signed-off-by: Muneendra <muneendra.kumar@xxxxxxxxxxxx>

---
v3:
New Patch
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index e09e0310b4c8..0c9334e8f036 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -1663,8 +1663,15 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd,
 	struct ibmvfc_event *evt;
 	int rc;
 
-	if (unlikely((rc = fc_remote_port_chkready(rport))) ||
-	    unlikely((rc = ibmvfc_host_chkready(vhost)))) {
+	rc = fc_remote_port_chkready(rport, cmnd);
+	if (unlikely(rc)) {
+		cmnd->result = rc;
+		done(cmnd);
+		return 0;
+	}
+
+	rc = ibmvfc_host_chkready(vhost);
+	if (unlikely(rc)) {
 		cmnd->result = rc;
 		done(cmnd);
 		return 0;
@@ -1934,8 +1941,19 @@ static int ibmvfc_bsg_request(struct bsg_job *job)
 
 	spin_lock_irqsave(vhost->host->host_lock, flags);
 
-	if (unlikely(rc || (rport && (rc = fc_remote_port_chkready(rport)))) ||
-	    unlikely((rc = ibmvfc_host_chkready(vhost)))) {
+	if (unlikely(rc)) {
+		spin_unlock_irqrestore(vhost->host->host_lock, flags);
+		goto out;
+	}
+
+	rc = fc_remote_port_chkready(rport, NULL);
+	if (rport && rc) {
+		spin_unlock_irqrestore(vhost->host->host_lock, flags);
+		goto out;
+	}
+
+	rc = ibmvfc_host_chkready(vhost);
+	if (unlikely(rc)) {
 		spin_unlock_irqrestore(vhost->host->host_lock, flags);
 		goto out;
 	}
@@ -2910,7 +2928,7 @@ static int ibmvfc_slave_alloc(struct scsi_device *sdev)
 	struct ibmvfc_host *vhost = shost_priv(shost);
 	unsigned long flags = 0;
 
-	if (!rport || fc_remote_port_chkready(rport))
+	if (!rport || fc_remote_port_chkready(rport, NULL))
 		return -ENXIO;
 
 	spin_lock_irqsave(shost->host_lock, flags);
-- 
2.26.2

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux