[openib-general] [PATCH][SDP][17/22] Whitespace cleanup in sdp_read.c

Tom Duffy Tom.Duffy at Sun.COM
Fri Feb 18 16:47:17 PST 2005


Signed-off-by: Tom Duffy <tduffy at sun.com>

Index: linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_read.c
===================================================================
--- linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_read.c	(revision 1836)
+++ linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_read.c	(working copy)
@@ -56,12 +56,9 @@ static int _sdp_event_read_advt(struct s
 	 */
 	advt = sdp_advt_q_look(&conn->src_actv);
 	if (NULL == advt || advt->wrid != comp->wr_id) {
-	
 		advt = sdp_advt_q_look(&conn->src_pend);
-		if (NULL != advt && advt->wrid == comp->wr_id) {
-			
+		if (NULL != advt && advt->wrid == comp->wr_id)
 			advt->flag &= ~SDP_ADVT_F_READ;
-		}
 
 		goto done;
 	}
@@ -82,17 +79,14 @@ static int _sdp_event_read_advt(struct s
 	 */
 	if (0 < (SDP_CONN_F_SRC_CANCEL_R & conn->flags) &&
 	    0 == conn->src_recv) {
-
 		conn->flags &= ~SDP_CONN_F_SRC_CANCEL_R;
 		conn->advt_seq = conn->recv_seq;
 		/*
 		 * If any data was canceled, post a SendSm, also
 		 */
 		if (0 < (SDP_CONN_F_SRC_CANCEL_C & conn->flags)) {
-
 			result = sdp_send_ctrl_send_sm(conn);
 			if (0 > result) {
-
 				sdp_dbg_warn(conn, "Error <%d> posting SendSm",
 					     result);
 				goto error;
@@ -128,7 +122,6 @@ int sdp_event_read(struct sdp_opt *conn,
 	 * error handling
 	 */
 	if (IB_WC_SUCCESS != comp->status) {
-
 		switch (comp->status) {
 		case IB_WC_WR_FLUSH_ERR:
 			/*
@@ -140,7 +133,6 @@ int sdp_event_read(struct sdp_opt *conn,
 			result = 0;
 			break;
 		default:
-
 			sdp_dbg_warn(conn, "Unhandled READ status <%d>.",
 				     comp->status);
 			result = -EIO;
@@ -175,12 +167,10 @@ int sdp_event_read(struct sdp_opt *conn,
 	type = sdp_desc_q_type_head(&conn->r_src);
 	switch (type) {
 	case SDP_DESC_TYPE_BUFF:
-
 		buff = (struct sdpc_buff *) sdp_desc_q_get_head(&conn->r_src);
 		SDP_EXPECT((NULL != buff));
 
 		if (comp->wr_id != buff->wrid) {
-
 			sdp_dbg_warn(conn, "work request mismatch <%llu:%llu>",
 				     (unsigned long long)comp->wr_id,
 				     (unsigned long long)buff->wrid);
@@ -202,14 +192,10 @@ int sdp_event_read(struct sdp_opt *conn,
 			conn->byte_strm += result;
 
 			sdp_inet_wake_recv(conn->sk, conn->byte_strm);
-		}
-		else {
-
-			if (0 > result) {
-
+		} else {
+			if (0 > result)
 				sdp_dbg_warn(conn, "Error <%d> receiving buff",
 					     result);
-			}
 
 			result = sdp_buff_pool_put(buff);
 			SDP_EXPECT(!(0 > result));
@@ -217,12 +203,9 @@ int sdp_event_read(struct sdp_opt *conn,
 
 		break;
 	case SDP_DESC_TYPE_IOCB:
-
 		iocb = (struct sdpc_iocb *) sdp_desc_q_look_head(&conn->r_src);
-		if (NULL == iocb || iocb->wrid != comp->wr_id) {
-
+		if (NULL == iocb || iocb->wrid != comp->wr_id)
 			break;
-		}
 
 		iocb = (struct sdpc_iocb *)sdp_desc_q_get_head(&conn->r_src);
 		SDP_EXPECT((NULL != iocb));
@@ -234,7 +217,6 @@ int sdp_event_read(struct sdp_opt *conn,
 
 		result = sdp_iocb_complete(iocb, 0);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> completing iocb. <%d>",
 				      result, iocb->key);
 			goto done;
@@ -242,25 +224,19 @@ int sdp_event_read(struct sdp_opt *conn,
 
 		break;
 	case SDP_DESC_TYPE_NONE:
-
 		iocb = sdp_iocb_q_look(&conn->r_pend);
 		if (NULL == iocb) {
-
 			result = -EPROTO;
 			goto done;
 		}
 
-		if (iocb->wrid != comp->wr_id) {
-
+		if (iocb->wrid != comp->wr_id)
 			break;
-		}
 
 		iocb->flags &= ~(SDP_IOCB_F_ACTIVE | SDP_IOCB_F_RDMA_R);
 
-		if (conn->sk->sk_rcvlowat > iocb->post) {
-
+		if (conn->sk->sk_rcvlowat > iocb->post)
 			break;
-		}
 
 		iocb = sdp_iocb_q_get_head(&conn->r_pend);
 		SDP_EXPECT((NULL != iocb));
@@ -270,7 +246,6 @@ int sdp_event_read(struct sdp_opt *conn,
 
 		result = sdp_iocb_complete(iocb, 0);
 		if (0 > result) {
-				
 			sdp_dbg_warn(conn, "Error <%d> completing iocb. <%d>",
 				     result, iocb->key);
 			goto done;
@@ -278,7 +253,6 @@ int sdp_event_read(struct sdp_opt *conn,
 
 		break;
 	default:
-
 		sdp_warn("Unknown type <%d> at head of READ SRC queue. <%d>",
 			 type, sdp_desc_q_size(&conn->r_src));
 		result = -EPROTO;
@@ -289,7 +263,6 @@ int sdp_event_read(struct sdp_opt *conn,
 	 */
 	result = _sdp_event_read_advt(conn, comp);
 	if (0 > result) {
-
 		sdp_dbg_warn(conn, "Error <%d> handling READ advertisment",
 			     result);
 		goto done;
@@ -300,7 +273,6 @@ int sdp_event_read(struct sdp_opt *conn,
 	 */
 	result = sdp_send_flush(conn);
 	if (0 > result) {
-
 		sdp_dbg_warn(conn, "Error <%d> flushing send queue.", result);
 		goto done;
 	}
@@ -310,7 +282,6 @@ int sdp_event_read(struct sdp_opt *conn,
 	 */
 	result = sdp_recv_flush(conn);
 	if (0 > result) {
-
 		sdp_dbg_warn(conn, "Error <%d> flushing recv queue.", result);
 		goto done;
 	}




More information about the general mailing list