[openib-general] [PATCH][SDP][21/22] Whitespace cleanup in sdp_wall.c

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


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

Index: linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_wall.c
===================================================================
--- linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_wall.c	(revision 1836)
+++ linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_wall.c	(working copy)
@@ -64,12 +64,9 @@ int sdp_wall_send_close(struct sdp_opt *
 		 * clear out the sent HelloAck message
 		 */
 		buff = sdp_buff_q_get_head(&conn->send_post);
-		if (NULL == buff) {
-
+		if (NULL == buff)
 			sdp_dbg_warn(conn, "Error, hello ack missing.");
-		}
 		else {
-
 			result = sdp_buff_pool_put(buff);
 			SDP_EXPECT(!(0 > result));
 		}
@@ -92,7 +89,6 @@ int sdp_wall_send_close(struct sdp_opt *
 
 		result = sdp_send_ctrl_disconnect(conn);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, 
 				     "Error <%d> send disconnect request",
 				     result);
@@ -114,10 +110,8 @@ error:
 	SDP_CONN_ST_SET(conn, SDP_CONN_ST_ERROR_STRM);
 
 	result = sdp_cm_disconnect(conn);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> CM disconnect send", result);
-	}
 
 	return result;
 } /* sdp_wall_send_close */
@@ -150,7 +144,6 @@ int sdp_wall_send_closing(struct sdp_opt
 
 		result = sdp_send_ctrl_disconnect(conn);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn,
 				     "Error <%d> send disconnect request",
 				     result);
@@ -158,7 +151,6 @@ int sdp_wall_send_closing(struct sdp_opt
 		}
 		break;
 	default:
-
 		sdp_dbg_warn(conn, "Incorrect state for disconnect");
 		result = -EBADE;
 		goto error;
@@ -172,10 +164,8 @@ error:
 	SDP_CONN_ST_SET(conn, SDP_CONN_ST_ERROR_STRM);
 
 	result = sdp_cm_disconnect(conn);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> CM disconnect send", result);
-	}
 
 	return result;
 } /* sdp_wall_send_closing */
@@ -194,7 +184,6 @@ int sdp_wall_send_abort(struct sdp_opt *
 		     conn->dst_addr, conn->dst_port);
 
 	switch (conn->state) {
-
 	case SDP_CONN_ST_DIS_SENT_1:	/* IBTA v1.1 spec A4.5.3.2 */
 		/*
 		 * clear the pending control buffer.
@@ -206,7 +195,6 @@ int sdp_wall_send_abort(struct sdp_opt *
 		 */
 	case SDP_CONN_ST_DIS_SEND_1:	/* don't touch control queue, diconnect
 					   message may still be queued. */
-
 		result = sdp_desc_q_clear(&conn->send_queue);
 		SDP_EXPECT(!(0 > result));
 		/*
@@ -214,7 +202,6 @@ int sdp_wall_send_abort(struct sdp_opt *
 		 */
 		result = sdp_send_ctrl_abort(conn);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> send abort request",
 				     result);
 			goto error;
@@ -287,10 +274,8 @@ error:
 	SDP_CONN_ST_SET(conn, SDP_CONN_ST_ERROR_STRM);
 
 	result = sdp_cm_disconnect(conn);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> CM disconnect send", result);
-	}
 
 	return 0;
 } /* sdp_wall_send_abort */
@@ -321,11 +306,9 @@ int sdp_wall_recv_reject(struct sdp_opt 
 	conn->shutdown = SHUTDOWN_MASK;
 
 	result = sdp_iocb_q_cancel_all(conn, (0 - error));
-	if (0 > result) {
-		
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> canceling outstanding IOCBs",
 			     result);
-	}
 
 	sdp_inet_wake_error(conn->sk);
 
@@ -351,7 +334,6 @@ int sdp_wall_recv_confirm(struct sdp_opt
 
         qp_attr = kmalloc(sizeof(*qp_attr), GFP_KERNEL);
         if (!qp_attr) {
-
                 result = -ENOMEM;
 		goto error;
         }
@@ -362,7 +344,6 @@ int sdp_wall_recv_confirm(struct sdp_opt
 
 	result = ib_cm_init_qp_attr(conn->cm_id, qp_attr, &attr_mask);
 	if (result) {
-		
 		sdp_dbg_warn(conn, "Error <%d> QP attributes for RTS",
 			     result);
 		goto error;
@@ -370,20 +351,16 @@ int sdp_wall_recv_confirm(struct sdp_opt
 
         result = ib_modify_qp(conn->qp, qp_attr, attr_mask);
         kfree(qp_attr);
-	if (result) {
-	
+	if (result)
 		goto error;
-	}
 
 	switch (conn->istate) {
 	case SDP_SOCK_ST_ACCEPTING:
-
 		conn->istate = SDP_SOCK_ST_ACCEPTED;
 		conn->send_buf = SDP_INET_SEND_SIZE;
 
 		break;
 	case SDP_SOCK_ST_ACCEPTED:
-
 		conn->istate = SDP_SOCK_ST_ESTABLISHED;
 		conn->send_buf = SDP_INET_SEND_SIZE;
 
@@ -391,7 +368,6 @@ int sdp_wall_recv_confirm(struct sdp_opt
 
 		break;
 	default:
-
 		result = -EPROTO;
 		goto error;
 	}
@@ -425,7 +401,6 @@ int sdp_wall_recv_failed(struct sdp_opt 
 
 	switch (conn->istate) {
 	default:
-
 		SDP_CONN_SET_ERR(conn, error);
 		conn->sk->sk_socket->state = SS_UNCONNECTED;
 		sdp_inet_wake_error(conn->sk);
@@ -433,7 +408,6 @@ int sdp_wall_recv_failed(struct sdp_opt 
 		 * fall through
 		 */
 	case SDP_SOCK_ST_ACCEPTING:
-
 		conn->istate = SDP_SOCK_ST_ERROR;
 		conn->shutdown = SHUTDOWN_MASK;
 		break;
@@ -470,7 +444,6 @@ int sdp_wall_recv_close(struct sdp_opt *
 
 		break;
 	default:
-
 		conn->istate = SDP_SOCK_ST_CLOSE;
 		conn->shutdown |= RCV_SHUTDOWN;
 		/*
@@ -478,12 +451,10 @@ int sdp_wall_recv_close(struct sdp_opt *
 		 * no more data from the peer.
 		 */
 		result = sdp_iocb_q_cancel_all_read(conn, 0);
-		if (0 > result) {
-
+		if (0 > result)
 			sdp_dbg_warn(conn, 
 				     "Error <%d> canceling outstanding IOCBs",
 				     result);
-		}
 		/*
 		 * async notification. POLL_HUP on full duplex close only.
 		 */
@@ -521,11 +492,9 @@ int sdp_wall_recv_closing(struct sdp_opt
 	 * from the peer.
 	 */
 	result = sdp_iocb_q_cancel_all_read(conn, 0);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> canceling outstanding IOCBs",
 			     result);
-	}
 
 	sdp_inet_wake_generic(conn->sk);
 	/*
@@ -574,11 +543,9 @@ int sdp_wall_recv_abort(struct sdp_opt *
 	 * cancel all outstanding IOCBs
 	 */
 	result = sdp_iocb_q_cancel_all(conn, -ECONNRESET);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> canceling outstanding IOCBs",
 			     result);
-	}
 
 	sdp_inet_wake_error(conn->sk);
 
@@ -610,18 +577,15 @@ int sdp_wall_recv_drop(struct sdp_opt *c
 		 * pull the listen sockets accept queue.
 		 */
 		result = sdp_inet_accept_q_remove(conn);
-		if (0 > result) {
-			
+		if (0 > result)
 			sdp_dbg_warn(conn, 
 				     "Error <%d> removing from accept queue.",
 				     result);
-		}
 
 		conn->istate = SDP_SOCK_ST_CLOSED;
 
 		break;
 	case SDP_SOCK_ST_CLOSING:
-
 		conn->istate = SDP_SOCK_ST_CLOSED;
 		sdp_inet_wake_generic(conn->sk);
 
@@ -638,11 +602,9 @@ int sdp_wall_recv_drop(struct sdp_opt *c
 		 * cancel all outstanding IOCBs
 		 */
 		result = sdp_iocb_q_cancel_all(conn, -ECONNRESET);
-		if (0 > result) {
-
+		if (0 > result)
 			sdp_dbg_warn(conn, "Error <%d> canceling all IOCBs",
 				     result);
-		}
 
 		sdp_inet_wake_error(conn->sk);
 
@@ -672,16 +634,12 @@ int sdp_wall_abort(struct sdp_opt *conn)
 	 * notify both halves of the wall that the connection is being aborted.
 	 */
 	result = sdp_wall_recv_abort(conn);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> recving abort request", result);
-	}
 	/* if */
 	result = sdp_wall_send_abort(conn);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> sending abort request", result);
-	}
 
 	return 0;
 } /* sdp_wall_abort */




More information about the general mailing list