[Open-FCoE] [PATCH] libfc: Add newlines to print statements in LP, RP and NS

Robert Love robert.w.love at intel.com
Mon Sep 8 16:23:03 UTC 2008


Signed-off-by: Robert Love <robert.w.love at intel.com>
---

 drivers/scsi/libfc/fc_lport.c |   20 ++++++++++----------
 drivers/scsi/libfc/fc_ns.c    |   35 ++++++++++++++++++-----------------
 drivers/scsi/libfc/fc_rport.c |   34 +++++++++++++++++-----------------
 3 files changed, 45 insertions(+), 44 deletions(-)

diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index aaeab59..333cbdf 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -148,7 +148,7 @@ static void fc_lport_set_fid(struct fc_lport *lp, u32 fid)
 		return;
 
 	if (fc_lport_debug)
-		FC_DBG("changing local port fid from %x to %x",
+		FC_DBG("changing local port fid from %x to %x\n",
 		       lp->fid, fid);
 	lp->fid = fid;
 	lp->tt.rport_reset_list(lp);
@@ -513,10 +513,10 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in,
 	remote_wwpn = get_unaligned_be64(&flp->fl_wwpn);
 	if (remote_wwpn == lp->wwpn) {
 		FC_DBG("FLOGI from port with same WWPN %llx "
-		       "possible configuration error.", remote_wwpn);
+		       "possible configuration error\n", remote_wwpn);
 		goto out;
 	}
-	FC_DBG("FLOGI from port WWPN %llx ", remote_wwpn);
+	FC_DBG("FLOGI from port WWPN %llx\n", remote_wwpn);
 	fc_lport_lock(lp);
 
 	/*
@@ -629,7 +629,7 @@ static void fc_lport_recv(struct fc_lport *lp, struct fc_seq *sp,
 			}
 		}
 	} else {
-		FC_DBG("dropping invalid frame (eof %x)", fr_eof(fp));
+		FC_DBG("dropping invalid frame (eof %x)\n", fr_eof(fp));
 		fc_frame_free(fp);
 	}
 
@@ -648,7 +648,7 @@ static void fc_lport_recv(struct fc_lport *lp, struct fc_seq *sp,
 int fc_lport_enter_reset(struct fc_lport *lp)
 {
 	if (fc_lport_debug)
-		FC_DBG("Processing RESET state");
+		FC_DBG("Processing RESET state\n");
 
 	if (lp->dns_rp) {
 		fc_remote_port_delete(lp->dns_rp);
@@ -692,7 +692,7 @@ static void fc_lport_error(struct fc_lport *lp, struct fc_frame *fp)
 		}
 	}
 	if (fc_lport_debug)
-		FC_DBG("error %ld retries %d limit %d",
+		FC_DBG("error %ld retries %d limit %d\n",
 		       PTR_ERR(fp), lp->retry_count, lp->max_retry_count);
 	fc_lport_unlock(lp);
 }
@@ -728,7 +728,7 @@ static void fc_lport_enter_logo(struct fc_lport *lp)
 	struct fc_els_logo *logo;
 
 	if (fc_lport_debug)
-		FC_DBG("Processing LOGO state");
+		FC_DBG("Processing LOGO state\n");
 
 	fc_lport_state_enter(lp, LPORT_ST_LOGO);
 
@@ -794,7 +794,7 @@ fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, void *lp_arg)
 	did = ntoh24(fh->fh_d_id);
 	if (fc_frame_payload_op(fp) == ELS_LS_ACC && did != 0) {
 		if (fc_lport_debug)
-			FC_DBG("assigned fid %x", did);
+			FC_DBG("assigned fid %x\n", did);
 		fc_lport_lock(lp);
 		fc_lport_set_fid(lp, did);
 		flp = fc_frame_payload_get(fp, sizeof(*flp));
@@ -813,7 +813,7 @@ fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, void *lp_arg)
 				if (e_d_tov > lp->e_d_tov)
 					lp->e_d_tov = e_d_tov;
 				lp->r_a_tov = 2 * e_d_tov;
-				FC_DBG("point-to-point mode");
+				FC_DBG("point-to-point mode\n");
 				fc_lport_ptp_setup(lp, ntoh24(fh->fh_s_id),
 						   get_unaligned_be64(
 							   &flp->fl_wwpn),
@@ -869,7 +869,7 @@ static void fc_lport_flogi_send(struct fc_lport *lp)
 void fc_lport_enter_flogi(struct fc_lport *lp)
 {
 	if (fc_lport_debug)
-		FC_DBG("Processing FLOGI state");
+		FC_DBG("Processing FLOGI state\n");
 	fc_lport_state_enter(lp, LPORT_ST_FLOGI);
 	fc_lport_flogi_send(lp);
 }
diff --git a/drivers/scsi/libfc/fc_ns.c b/drivers/scsi/libfc/fc_ns.c
index 6204bcc..5c9272c 100644
--- a/drivers/scsi/libfc/fc_ns.c
+++ b/drivers/scsi/libfc/fc_ns.c
@@ -137,7 +137,7 @@ static void fc_ns_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
 	lp->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL);
 	if (redisc) {
 		if (fc_ns_debug)
-			FC_DBG("RSCN received: rediscovering");
+			FC_DBG("RSCN received: rediscovering\n");
 		list_for_each_entry_safe(dp, next, &disc_list, peers) {
 			list_del(&dp->peers);
 			kfree(dp);
@@ -146,7 +146,7 @@ static void fc_ns_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
 	} else {
 		if (fc_ns_debug)
 			FC_DBG("RSCN received: not rediscovering. "
-				"redisc %d state %d in_prog %d",
+				"redisc %d state %d in_prog %d\n",
 				redisc, lp->state, lp->ns_disc_pending);
 		list_for_each_entry_safe(dp, next, &disc_list, peers) {
 			list_del(&dp->peers);
@@ -211,7 +211,7 @@ static void fc_ns_enter_scr(struct fc_lport *lp)
 	struct fc_els_scr *scr;
 
 	if (fc_ns_debug)
-		FC_DBG("Processing SCR state");
+		FC_DBG("Processing SCR state\n");
 
 	fc_lport_state_enter(lp, LPORT_ST_SCR);
 
@@ -248,7 +248,7 @@ static void fc_ns_enter_reg_ft(struct fc_lport *lp)
 	int i;
 
 	if (fc_ns_debug)
-		FC_DBG("Processing REG_FT state");
+		FC_DBG("Processing REG_FT state\n");
 
 	fc_lport_state_enter(lp, LPORT_ST_REG_FT);
 
@@ -497,7 +497,7 @@ static void fc_ns_error(struct fc_lport *lp, struct fc_frame *fp)
 		}
 	}
 	if (fc_ns_debug)
-		FC_DBG("error %ld retries %d limit %d",
+		FC_DBG("error %ld retries %d limit %d\n",
 		       PTR_ERR(fp), lp->retry_count, lp->max_retry_count);
 	fc_lport_unlock(lp);
 }
@@ -706,12 +706,12 @@ static void fcdt_ns_error(struct fc_lport *lp, struct fc_frame *fp)
 		if (lp->ns_disc_retry_count++ < FC_NS_RETRY_LIMIT) {
 			fc_ns_gpn_ft_req(lp);
 		} else {
-			FC_DBG("err %d - ending", err);
+			FC_DBG("err %d - ending\n", err);
 			fc_ns_disc_done(lp);
 		}
 		break;
 	default:
-		FC_DBG("err %d - ending", err);
+		FC_DBG("err %d - ending\n", err);
 		fc_ns_disc_done(lp);
 		break;
 	}
@@ -851,7 +851,7 @@ static void fc_ns_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
 	    lp->ns_disc_seq_count == 0) {
 		cp = fc_frame_payload_get(fp, sizeof(*cp));
 		if (cp == NULL) {
-			FC_DBG("GPN_FT response too short.  len %d",
+			FC_DBG("GPN_FT response too short, len %d\n",
 			       fr_len(fp));
 		} else if (ntohs(cp->ct_cmd) == FC_FS_ACC) {
 
@@ -862,7 +862,8 @@ static void fc_ns_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
 			len -= sizeof(*cp);
 		} else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
 			FC_DBG("GPN_FT rejected reason %x exp %x "
-			       "(check zoning)", cp->ct_reason, cp->ct_explan);
+			       "(check zoning)\n", cp->ct_reason,
+			       cp->ct_explan);
 			fc_ns_disc_done(lp);
 		} else {
 			FC_DBG("GPN_FT unexpected response code %x\n",
@@ -873,7 +874,7 @@ static void fc_ns_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
 		buf = fh + 1;
 	} else {
 		FC_DBG("GPN_FT unexpected frame - out of sequence? "
-		       "seq_cnt %x expected %x sof %x eof %x",
+		       "seq_cnt %x expected %x sof %x eof %x\n",
 		       seq_cnt, lp->ns_disc_seq_count, fr_sof(fp), fr_eof(fp));
 	}
 	if (buf) {
@@ -977,7 +978,7 @@ static void fc_ns_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
 
 	cp = fc_frame_payload_get(fp, sizeof(cp->ct));
 	if (cp == NULL) {
-		FC_DBG("GPN_ID response too short.  len %d", fr_len(fp));
+		FC_DBG("GPN_ID response too short, len %d\n", fr_len(fp));
 		return;
 	}
 	cmd = ntohs(cp->ct.ct_cmd);
@@ -985,7 +986,7 @@ static void fc_ns_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
 	case FC_FS_ACC:
 		cp = fc_frame_payload_get(fp, sizeof(*cp));
 		if (cp == NULL) {
-			FC_DBG("GPN_ID response payload too short.  len %d",
+			FC_DBG("GPN_ID response payload too short, len %d\n",
 			       fr_len(fp));
 			break;
 		}
@@ -1037,7 +1038,7 @@ static void fc_ns_enter_dns(struct fc_lport *lp)
 	};
 
 	if (fc_ns_debug)
-		FC_DBG("Processing DNS state");
+		FC_DBG("Processing DNS state\n");
 
 	fc_lport_state_enter(lp, LPORT_ST_DNS);
 
@@ -1090,7 +1091,7 @@ static void fc_ns_enter_dns_stop(struct fc_lport *lp)
 	struct fc_rport *rport = lp->dns_rp;
 
 	if (fc_ns_debug)
-		FC_DBG("Processing DNS_STOP state");
+		FC_DBG("Processing DNS_STOP state\n");
 
 	fc_lport_state_enter(lp, LPORT_ST_DNS_STOP);
 
@@ -1126,7 +1127,7 @@ static void fc_ns_enter_reg_pn(struct fc_lport *lp)
 	} *req;
 
 	if (fc_ns_debug)
-		FC_DBG("Processing REG_PN state");
+		FC_DBG("Processing REG_PN state\n");
 
 	fc_lport_state_enter(lp, LPORT_ST_REG_PN);
 	fp = fc_frame_alloc(lp, sizeof(*req));
@@ -1234,7 +1235,7 @@ static void fc_ns_gnn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
 
 	cp = fc_frame_payload_get(fp, sizeof(cp->ct));
 	if (cp == NULL) {
-		FC_DBG("GNN_ID response too short.  len %d", fr_len(fp));
+		FC_DBG("GNN_ID response too short, len %d\n", fr_len(fp));
 		return;
 	}
 	cmd = ntohs(cp->ct.ct_cmd);
@@ -1242,7 +1243,7 @@ static void fc_ns_gnn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
 	case FC_FS_ACC:
 		cp = fc_frame_payload_get(fp, sizeof(*cp));
 		if (cp == NULL) {
-			FC_DBG("GNN_ID response payload too short.  len %d",
+			FC_DBG("GNN_ID response payload too short, len %d\n",
 			       fr_len(fp));
 			break;
 		}
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index cd559dd..6d0c970 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -211,7 +211,7 @@ int fc_rport_login(struct fc_rport *rport)
 		fc_rport_state_enter(rport, RPORT_ST_INIT);
 		fc_rport_unlock(rport);
 		if (fc_rp_debug)
-			FC_DBG("remote %6x closed", rport->port_id);
+			FC_DBG("remote %6x closed\n", rport->port_id);
 
 		if (rport == lp->dns_rp &&
 		    lp->state != LPORT_ST_RESET) {
@@ -254,7 +254,7 @@ int fc_rport_logout(struct fc_rport *rport)
 		fc_rport_state_enter(rport, RPORT_ST_INIT);
 		fc_rport_unlock(rport);
 		if (fc_rp_debug)
-			FC_DBG("remote %6x closed", rport->port_id);
+			FC_DBG("remote %6x closed\n", rport->port_id);
 		if (rport == lp->dns_rp &&
 		    lp->state != LPORT_ST_RESET) {
 			fc_lport_lock(lp);
@@ -287,7 +287,7 @@ void fc_rport_reset(struct fc_rport *rport)
 	struct fc_lport *lp;
 
 	if (fc_rp_debug)
-		FC_DBG("sess to %6x reset", rport->port_id);
+		FC_DBG("sess to %6x reset\n", rport->port_id);
 	fc_rport_lock(rport);
 
 	lp = rp->local_port;
@@ -295,7 +295,7 @@ void fc_rport_reset(struct fc_rport *rport)
 	fc_rport_unlock(rport);
 
 	if (fc_rp_debug)
-		FC_DBG("remote %6x closed", rport->port_id);
+		FC_DBG("remote %6x closed\n", rport->port_id);
 	if (rport == lp->dns_rp &&
 	    lp->state != LPORT_ST_RESET) {
 		fc_lport_lock(lp);
@@ -373,7 +373,7 @@ static void fc_rport_reject(struct fc_rport *rport)
 	case RPORT_ST_RTV:
 		fc_rport_state_enter(rport, RPORT_ST_READY);
 		if (fc_rp_debug)
-			FC_DBG("remote %6x ready", rport->port_id);
+			FC_DBG("remote %6x ready\n", rport->port_id);
 		if (rport == lp->dns_rp &&
 		    lp->state == LPORT_ST_DNS) {
 			fc_lport_lock(lp);
@@ -385,7 +385,7 @@ static void fc_rport_reject(struct fc_rport *rport)
 	case RPORT_ST_LOGO:
 		fc_rport_state_enter(rport, RPORT_ST_INIT);
 		if (fc_rp_debug)
-			FC_DBG("remote %6x closed", rport->port_id);
+			FC_DBG("remote %6x closed\n", rport->port_id);
 		if (rport == lp->dns_rp &&
 		    lp->state != LPORT_ST_RESET) {
 			fc_lport_lock(lp);
@@ -534,7 +534,7 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp,
 				fc_rport_enter_prli(rport);
 		} else {
 			if (fc_rp_debug)
-				FC_DBG("bad PLOGI response");
+				FC_DBG("bad PLOGI response\n");
 
 			rjp = fc_frame_payload_get(fp, sizeof(*rjp));
 			if (op == ELS_LS_RJT && rjp != NULL &&
@@ -717,7 +717,7 @@ static void fc_rport_enter_prli(struct fc_rport *rport)
 	if (rport->port_id >= FC_FID_DOM_MGR) {
 		fc_rport_state_enter(rport, RPORT_ST_READY);
 		if (fc_rp_debug)
-			FC_DBG("remote %6x ready", rport->port_id);
+			FC_DBG("remote %6x ready\n", rport->port_id);
 		if (rport == lp->dns_rp &&
 		    lp->state == LPORT_ST_DNS) {
 			fc_lport_lock(lp);
@@ -795,7 +795,7 @@ static void fc_rport_rtv_resp(struct fc_seq *sp, struct fc_frame *fp,
 	fc_rport_state_enter(rport, RPORT_ST_READY);
 	fc_rport_unlock(rport);
 	if (fc_rp_debug)
-		FC_DBG("remote %6x ready", rport->port_id);
+		FC_DBG("remote %6x ready\n", rport->port_id);
 	if (rport == lp->dns_rp &&
 	    lp->state == LPORT_ST_DNS) {
 		fc_lport_lock(lp);
@@ -950,7 +950,7 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
 	sid = ntoh24(fh->fh_s_id);
 	pl = fc_frame_payload_get(fp, sizeof(*pl));
 	if (!pl) {
-		FC_DBG("incoming PLOGI from %x too short", sid);
+		FC_DBG("incoming PLOGI from %x too short\n", sid);
 		WARN_ON(1);
 		/* XXX TBD: send reject? */
 		fc_frame_free(fp);
@@ -993,7 +993,7 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
 		break;
 	case RPORT_ST_PLOGI:
 		if (fc_rp_debug)
-			FC_DBG("incoming PLOGI from %x in PLOGI state %d",
+			FC_DBG("incoming PLOGI from %x in PLOGI state %d\n",
 			       sid, rp->rp_state);
 		if (wwpn < lp->wwpn)
 			reject = ELS_RJT_INPROG;
@@ -1003,14 +1003,14 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
 	case RPORT_ST_READY:
 		if (fc_rp_debug)
 			FC_DBG("incoming PLOGI from %x in logged-in state %d "
-			       "- ignored for now", sid, rp->rp_state);
+			       "- ignored for now\n", sid, rp->rp_state);
 		/* XXX TBD - should reset */
 		break;
 	case RPORT_ST_NONE:
 	default:
 		if (fc_rp_debug)
-			FC_DBG("incoming PLOGI from %x in unexpected state %d",
-			       sid, rp->rp_state);
+			FC_DBG("incoming PLOGI from %x in unexpected "
+			       "state %d\n", sid, rp->rp_state);
 		break;
 	}
 
@@ -1192,7 +1192,7 @@ static void fc_rport_recv_prli_req(struct fc_rport *rport,
 		case RPORT_ST_PRLI:
 			fc_rport_state_enter(rport, RPORT_ST_READY);
 			if (fc_rp_debug)
-				FC_DBG("remote %6x ready", rport->port_id);
+				FC_DBG("remote %6x ready\n", rport->port_id);
 			if (rport == lp->dns_rp &&
 			    lp->state == LPORT_ST_DNS) {
 				fc_lport_lock(lp);
@@ -1226,7 +1226,7 @@ static void fc_rport_recv_prlo_req(struct fc_rport *rport, struct fc_seq *sp,
 	struct fc_seq_els_data rjt_data;
 
 	fh = fc_frame_header_get(fp);
-	FC_DBG("incoming PRLO from %x state %d",
+	FC_DBG("incoming PRLO from %x state %d\n",
 	       ntoh24(fh->fh_s_id), rp->rp_state);
 	rjt_data.fp = NULL;
 	rjt_data.reason = ELS_RJT_UNAB;
@@ -1253,7 +1253,7 @@ static void fc_rport_recv_logo_req(struct fc_rport *rport, struct fc_seq *sp,
 	fc_rport_state_enter(rport, RPORT_ST_INIT);
 	fc_rport_unlock(rport);
 	if (fc_rp_debug)
-		FC_DBG("remote %6x closed", rport->port_id);
+		FC_DBG("remote %6x closed\n", rport->port_id);
 	if (rport == lp->dns_rp &&
 	    lp->state != LPORT_ST_RESET) {
 		fc_lport_lock(lp);




More information about the devel mailing list