[Open-FCoE] [PATCH 4/5] Fixed errors reported by checkpatch

Vasu Dev vasu.dev at intel.com
Tue Apr 1 14:12:44 UTC 2008


Just fixed checkpatch ERRORs in this patch to avoid checkpatch
erros in  next patch having other code changes along same code
lines.

1) removed assignment within conditional statement as that was causing style
error in next patch, if ((fp = fc_frame_alloc(lp->dev, sizeof(*pl))) == NULL)

2) used __func__ instead __FUNCTION__ recommended by checkpatch.

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

 drivers/scsi/ofc/include/fc_frame.h |    4 +-
 drivers/scsi/ofc/openfc/fc_sess.c   |   57 +++++++++++++++++++----------------
 2 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/drivers/scsi/ofc/include/fc_frame.h b/drivers/scsi/ofc/include/fc_frame.h
index 219a45b..b69ad8f 100644
--- a/drivers/scsi/ofc/include/fc_frame.h
+++ b/drivers/scsi/ofc/include/fc_frame.h
@@ -73,7 +73,7 @@ struct fc_frame {
  * Add a "stamp" indicating where a frame was last used.
  */
 #ifdef FC_FRAME_DEBUG
-#define FC_FRAME_STAMP(fp)  (fp)->fr_stamp = __FUNCTION__
+#define FC_FRAME_STAMP(fp)  (fp)->fr_stamp = __func__
 #else
 #define FC_FRAME_STAMP(fp)
 #endif /* FC_FRAME_DEBUG */
@@ -157,7 +157,7 @@ static inline struct fc_frame *fc_frame_alloc_inline(struct fc_port *port,
  * This version of fc_frame_alloc() stamps the frame to help find leaks.
  */
 #define fc_frame_alloc(port, len) \
-	fc_frame_alloc_inline(port, len, __FUNCTION__)
+	fc_frame_alloc_inline(port, len, __func__)
 /*
  * Free the fc_frame structure and buffer.
  */
diff --git a/drivers/scsi/ofc/openfc/fc_sess.c b/drivers/scsi/ofc/openfc/fc_sess.c
index cf09b48..4e20f12 100644
--- a/drivers/scsi/ofc/openfc/fc_sess.c
+++ b/drivers/scsi/ofc/openfc/fc_sess.c
@@ -1267,35 +1267,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);
 }




More information about the devel mailing list