linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: michaelc@cs.wisc.edu
To: linux-scsi@vger.kernel.org
Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>,
	John Soni Jose <sony.john-n@emulex.com>,
	Mike Christie <michaelc@cs.wisc.edu>
Subject: [PATCH 08/17] be2iscsi:Code cleanup, removing the goto statement
Date: Tue,  3 Apr 2012 23:41:43 -0500	[thread overview]
Message-ID: <1333514512-21799-9-git-send-email-michaelc@cs.wisc.edu> (raw)
In-Reply-To: <1333514512-21799-1-git-send-email-michaelc@cs.wisc.edu>

From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/be2iscsi/be_main.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 7291d6e..7138f59 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -147,15 +147,15 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc)
 	struct invalidate_command_table *inv_tbl;
 	struct be_dma_mem nonemb_cmd;
 	unsigned int cid, tag, i, num_invalidate;
-	int rc = FAILED;
 
 	/* invalidate iocbs */
 	cls_session = starget_to_session(scsi_target(sc->device));
 	session = cls_session->dd_data;
 	spin_lock_bh(&session->lock);
-	if (!session->leadconn || session->state != ISCSI_STATE_LOGGED_IN)
-		goto unlock;
-
+	if (!session->leadconn || session->state != ISCSI_STATE_LOGGED_IN) {
+		spin_unlock_bh(&session->lock);
+		return FAILED;
+	}
 	conn = session->leadconn;
 	beiscsi_conn = conn->dd_data;
 	phba = beiscsi_conn->phba;
@@ -208,9 +208,6 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc)
 	pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size,
 			    nonemb_cmd.va, nonemb_cmd.dma);
 	return iscsi_eh_device_reset(sc);
-unlock:
-	spin_unlock_bh(&session->lock);
-	return rc;
 }
 
 static ssize_t beiscsi_show_boot_tgt_info(void *data, int type, char *buf)
-- 
1.7.7.6


  parent reply	other threads:[~2012-04-04  4:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04  4:41 be2iscsi update v2 michaelc
2012-04-04  4:41 ` [PATCH 01/17] be2iscsi: Fix in the Asynchronous Code Path michaelc
2012-04-04  4:41 ` [PATCH 02/17] be2iscsi: Fix in ASYNC PDU stitching logic michaelc
2012-04-04  4:41 ` [PATCH 03/17] be2iscsi: WRB Initialization and Failure code path change michaelc
2012-04-04  4:41 ` [PATCH 04/17] be2iscsi:Freeing of WRB and SGL Handle in cleanup task michaelc
2012-04-18  8:06   ` Mike Christie
2012-04-04  4:41 ` [PATCH 05/17] be2iscsi:Fix typo function name mismatch michaelc
2012-04-04  4:41 ` [PATCH 06/17] be2iscsi:Set num_cpu = 1 if pci_enable_msix fails michaelc
2012-04-04  4:41 ` [PATCH 07/17] be2iscsi:Fix double free of MCCQ info memory michaelc
2012-04-25  8:13   ` James Bottomley
2012-04-25 19:27     ` Jayamohan.Kallickal
2012-04-04  4:41 ` michaelc [this message]
2012-04-04  4:41 ` [PATCH 09/17] be2iscsi:Fix the function return values michaelc
2012-04-04  4:41 ` [PATCH 10/17] be2iscsi: Update in Copyright information michaelc
2012-04-25  8:23   ` James Bottomley
2012-04-25 16:49     ` Jayamohan.Kallickal
2012-04-04  4:41 ` [PATCH 11/17] be2iscsi:Bump the driver Version michaelc
2012-04-04  4:41 ` [PATCH 12/17] be2iscsi: Check ASYNC PDU Handle corresponds to HDR/DATA Handle michaelc
2012-04-04  4:41 ` [PATCH 13/17] be2iscsi: Return async handle of unknown opcode to free list michaelc
2012-04-04  4:41 ` [PATCH 14/17] be2iscsi: Get Initiator Name for the iSCSI_Host michaelc
2012-04-04  4:41 ` [PATCH 15/17] be2iscsi: Adding bsg interface for be2iscsi michaelc
2012-04-04  4:41 ` [PATCH 16/17] be2iscsi: adding functionality to change network settings using iscsiadm michaelc
2012-04-04  4:41 ` [PATCH 17/17] be2iscsi: Get Port State and Speed of the Adapter michaelc
  -- strict thread matches above, loose matches on Subject: below --
2012-03-21  1:47 be2iscsi update michaelc
2012-03-21  1:47 ` [PATCH 08/17] be2iscsi:Code cleanup, removing the goto statement michaelc

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=1333514512-21799-9-git-send-email-michaelc@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=jayamohan.kallickal@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sony.john-n@emulex.com \
    /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;
as well as URLs for NNTP newsgroup(s).