All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasu Dev <vasu.dev@intel.com>
To: linux-scsi@vger.kernel.org, devel@open-fcoe.org
Subject: [PATCH 4/5] Fixed style error reported by checkpatch
Date: Mon, 25 Feb 2008 03:20:26 -0800	[thread overview]
Message-ID: <20080225112026.22380.24050.stgit@vdinit.jf.intel.com> (raw)
In-Reply-To: <20080225111856.22380.70951.stgit@vdinit.jf.intel.com>

Fixed checkpatch ERROR here: do not use assignment in if condition (+ }
else if ((fp = fc_frame_alloc(lp->dev, sizeof(*pl))) == NULL)

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
---

 drivers/scsi/ofc/libfc/fc_sess.c |   57 +++++++++++++++++++++-----------------
 1 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/drivers/scsi/ofc/libfc/fc_sess.c b/drivers/scsi/ofc/libfc/fc_sess.c
index 0d5f611..ff570e5 100644
--- a/drivers/scsi/ofc/libfc/fc_sess.c
+++ b/drivers/scsi/ofc/libfc/fc_sess.c
@@ -1189,35 +1189,40 @@ static void fc_sess_recv_plogi_req(struct fc_sess *sess,
 	if (reject) {
 		fc_seq_ls_rjt(sp, reject, ELS_EXPL_NONE);
 		fc_frame_free(fp);
-	} else if ((fp = fc_frame_alloc(lp->fl_port, sizeof(*pl))) == NULL) {
-		fp = rx_fp;
-		fc_seq_ls_rjt(sp, ELS_RJT_UNAB, ELS_EXPL_NONE);
-		fc_frame_free(fp);
 	} else {
-		sp = fc_seq_start_next(sp);
-		WARN_ON(!sp);
-		fc_frame_free(rx_fp);
-		fc_remote_port_set_name(rp, wwpn, wwnn);
+		fp = fc_frame_alloc(lp->fl_port, sizeof(*pl));
+		if (fp == NULL) {
+			fp = rx_fp;
+			fc_seq_ls_rjt(sp, ELS_RJT_UNAB, ELS_EXPL_NONE);
+			fc_frame_free(fp);
+		} else {
+			sp = fc_seq_start_next(sp);
+			WARN_ON(!sp);
+			fc_frame_free(rx_fp);
+			fc_remote_port_set_name(rp, wwpn, wwnn);
 
-		/*
-		 * Get session payload size from incoming PLOGI.
-		 */
-		sess->fs_max_payload = (uint16_t)
-		    fc_local_port_get_payload_size(pl, lp->fl_max_payload);
-		pl = fc_frame_payload_get(fp, sizeof(*pl));
-		WARN_ON(!pl);
-		fc_local_port_flogi_fill(lp, pl, ELS_LS_ACC);
+			/*
+			 * Get session payload size from incoming PLOGI.
+			 */
+			sess->fs_max_payload = (uint16_t)
+			    fc_local_port_get_payload_size(pl,
+							lp->fl_max_payload);
+			pl = fc_frame_payload_get(fp, sizeof(*pl));
+			WARN_ON(!pl);
+			fc_local_port_flogi_fill(lp, pl, ELS_LS_ACC);
 
-		/*
-		 * Send LS_ACC.  If this fails, the originator should retry.
-		 */
-		fc_seq_send_last(sp, fp, FC_RCTL_ELS_REP, FC_TYPE_ELS);
-		if (sess->fs_state == SESS_ST_PLOGI)
-			fc_sess_enter_prli(sess);
-		else
-			fc_sess_state_enter(sess, SESS_ST_PLOGI_RECV);
-		fc_sess_hold(sess);	/* represents login */
-		sess->fs_plogi_held = 1;
+			/*
+			 * Send LS_ACC.  If this fails,
+			 * the originator should retry.
+			 */
+			fc_seq_send_last(sp, fp, FC_RCTL_ELS_REP, FC_TYPE_ELS);
+			if (sess->fs_state == SESS_ST_PLOGI)
+				fc_sess_enter_prli(sess);
+			else
+				fc_sess_state_enter(sess, SESS_ST_PLOGI_RECV);
+			fc_sess_hold(sess);	/* represents login */
+			sess->fs_plogi_held = 1;
+		}
 	}
 	fc_sess_unlock_send(sess);
 }


  parent reply	other threads:[~2008-02-25 19:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25 11:20 [PATCH 0/5] Series short description Vasu Dev
2008-02-25 11:20 ` [PATCH 1/5] Removed outer port allocation Vasu Dev
2008-02-25 11:20 ` [PATCH 2/5] Removed outer port use from fcs Vasu Dev
2008-02-25 11:20 ` [PATCH 3/5] Removed outer port use in fc_exch Vasu Dev
2008-02-25 11:20 ` Vasu Dev [this message]
2008-02-25 11:20 ` [PATCH 5/5] Removed fc_port from fc_frame_alloc() Vasu Dev

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=20080225112026.22380.24050.stgit@vdinit.jf.intel.com \
    --to=vasu.dev@intel.com \
    --cc=devel@open-fcoe.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.