[openib-general] [PATCH][SDP][1/22] Whitespace cleanup in sdp_actv.c

Tom Duffy Tom.Duffy at Sun.COM
Fri Feb 18 16:44:32 PST 2005


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

Index: linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_actv.c
===================================================================
--- linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_actv.c	(revision 1836)
+++ linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_actv.c	(working copy)
@@ -61,10 +61,8 @@ static int _sdp_actv_conn_establish(stru
 	 * which it should have been.
 	 */
 	if (SDP_SOCK_ST_CONNECT == conn->istate) {
-
 		qp_attr = kmalloc(sizeof(*qp_attr), GFP_KERNEL);
 		if (!qp_attr) {
-
 			result = -ENOMEM;
 			goto error;
 		}
@@ -75,7 +73,6 @@ static int _sdp_actv_conn_establish(stru
 
 		result = ib_cm_init_qp_attr(conn->cm_id, qp_attr, &attr_mask);
 		if (result) {
-
 			sdp_dbg_warn(conn, "Error <%d> QP attributes for RTR",
 				     result);
 			goto error;
@@ -88,7 +85,6 @@ static int _sdp_actv_conn_establish(stru
 
 		result = ib_modify_qp(conn->qp, qp_attr, attr_mask);
 		if (result) {
-			
 			sdp_dbg_warn(conn, "Error <%d> QP modify to RTR",
 				     result);
 			goto error;
@@ -102,7 +98,6 @@ static int _sdp_actv_conn_establish(stru
 		 */
 		result = sdp_recv_flush(conn);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> posting recv buffers.",
 				     result);
 			goto error;
@@ -114,7 +109,6 @@ static int _sdp_actv_conn_establish(stru
 
 		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;
@@ -122,7 +116,6 @@ static int _sdp_actv_conn_establish(stru
 
 		result = ib_modify_qp(conn->qp, qp_attr, attr_mask);
 		if (result) {
-			
 			sdp_dbg_warn(conn, "Error <%d> QP modify to RTS",
 				     result);
 			goto error;
@@ -132,7 +125,6 @@ static int _sdp_actv_conn_establish(stru
 		 */
 		result = sdp_cm_confirm(conn);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> CM connect confirm",
 				     result);
 			goto error;
@@ -155,7 +147,6 @@ static int _sdp_actv_conn_establish(stru
 
 		result = sdp_send_flush(conn);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> flushing receives.",
 				     result);
 			goto error;
@@ -167,17 +158,14 @@ static int _sdp_actv_conn_establish(stru
 		sdp_inet_wake_recv(sk, 0);
 
 		kfree(qp_attr);
-	}
-	else {
+	} else {
 		/*
 		 * fail this connection
 		 */
 		result = sdp_cm_failed(conn);
-		if (0 > result) {
-
+		if (0 > result)
 			sdp_dbg_warn(conn, "Error <%d> CM connect failed", 
 				     result);
-		}
 
 		SDP_CONN_SET_ERR(conn, EPROTO);
 		conn->istate = SDP_SOCK_ST_ERROR;
@@ -212,7 +200,6 @@ static int _sdp_cm_hello_ack_check(struc
 	 * validation and consistency checks
 	 */
 	if (hello_ack->bsdh.size != sizeof(struct msg_hello_ack)) {
-
 		sdp_dbg_warn(NULL, "hello ack, size mismatch. (2) <%d:%Zu>",
 			     hello_ack->bsdh.size,
 			     sizeof(struct msg_hello_ack));
@@ -220,21 +207,18 @@ static int _sdp_cm_hello_ack_check(struc
 	}
 
 	if (SDP_MID_HELLO_ACK != hello_ack->bsdh.mid) {
-
 		sdp_dbg_warn(NULL, "hello ack, unexpected message. <%d>",
 			     hello_ack->bsdh.mid);
 		return -EINVAL;
 	}
 
 	if (!(0 < hello_ack->hah.max_adv)) {
-
 		sdp_dbg_warn(NULL, "hello ack, bad zcopy advertisment. <%d>",
 			     hello_ack->hah.max_adv);
 		return -EINVAL;
 	}
 
 	if ((0xF0 & hello_ack->hah.version) != (0xF0 & SDP_MSG_VERSION)) {
-
 		sdp_dbg_warn(NULL, "hello ack, version mismatch. <%d:%d>",
 			     ((0xF0 & hello_ack->hah.version) >> 4),
 			     ((0xF0 & SDP_MSG_VERSION) >> 4));
@@ -267,15 +251,12 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 	int result;
 	int error;
 
-	if (NULL == conn) {
+	if (NULL == conn)
 		return -EINVAL;
-	}
 	
-	if (cm_id != conn->cm_id) {
-
+	if (cm_id != conn->cm_id)
 		sdp_dbg_warn(conn, "REP comm ID mismatch. <%08x:%08x>",
 			     conn->cm_id->local_id, cm_id->local_id);
-	}
 
 	hello_ack = (struct msg_hello_ack *)event->private_data;
 
@@ -285,10 +266,8 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 	 */
 	switch (conn->state) {
 	case SDP_CONN_ST_ERROR_STRM:
-
 		result = sdp_cm_reject(conn);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> CM reject request",
 				     result);
 			error = result;
@@ -305,7 +284,6 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 		 */
 		result = _sdp_cm_hello_ack_check(hello_ack);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> hello ack check.",
 				     result);
 			error = result;
@@ -338,7 +316,6 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 
 		result = _sdp_actv_conn_establish(conn);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> accept receive failed",
 				     result);
 			error = result;
@@ -347,7 +324,6 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 
 		break;
 	default:
-
 		sdp_dbg_warn(conn, "REP received in unknown connection state");
 		/*
 		 * drop CM reference
@@ -394,7 +370,6 @@ static void _sdp_cm_path_complete(u64 id
 	 * path lookup is complete
 	 */
 	if (id != conn->plid) {
-
 		sdp_dbg_warn(conn, "Path record ID mismatch <%016llx:%016llx>",
 			     (unsigned long long)id, 
 			     (unsigned long long)conn->plid);
@@ -402,7 +377,6 @@ static void _sdp_cm_path_complete(u64 id
 	}
 
 	if (SDP_CONN_ST_REQ_PATH != conn->state) {
-
 		sdp_dbg_warn(conn, "Path record completion in bad state");
 		goto done;
 	}
@@ -417,7 +391,6 @@ static void _sdp_cm_path_complete(u64 id
 	 * create address handle
 	 */
 	if (0 != status) {
-
 		sdp_dbg_warn(conn, "Path record completion error <%d>",
 			     status);
 		goto failed;
@@ -434,7 +407,6 @@ static void _sdp_cm_path_complete(u64 id
 	 */
 	result = sdp_conn_alloc_ib(conn, ca, hw_port, path->pkey);
 	if (0 > result) {
-
 		sdp_dbg_warn(conn, "Error <%d> allocating IB connection",
 			     result);
 		goto failed;
@@ -445,7 +417,6 @@ static void _sdp_cm_path_complete(u64 id
 	 */
 	buff = sdp_buff_pool_get();
 	if (NULL == buff) {
-
 		sdp_dbg_warn(conn, "Failed to allocate buff for Hello Msg.");
 		goto failed;
 	}
@@ -488,7 +459,6 @@ static void _sdp_cm_path_complete(u64 id
 	 */
 	result = sdp_buff_q_put(&conn->send_post, buff);
 	if (0 > result) {
-
 		sdp_dbg_warn(conn, "Error <%d> buffering hello msg.", result);
 
 		expect = sdp_buff_pool_put(buff);
@@ -500,10 +470,8 @@ static void _sdp_cm_path_complete(u64 id
 	/*
 	 * Mellanox performance bug workaround.
 	 */
-	if (IB_MTU_1024 < path->mtu) {
-
+	if (IB_MTU_1024 < path->mtu)
 		path->mtu = IB_MTU_1024;
-	}
 #endif
 	conn->path_mtu = path->mtu;
 	/*
@@ -537,7 +505,6 @@ static void _sdp_cm_path_complete(u64 id
 	conn->cm_id = ib_create_cm_id(sdp_cm_event_handler,
 				      __hashent_arg(conn->hashent));
 	if (NULL == conn->cm_id) {
-
 		sdp_dbg_warn(conn, "Failed to create CM handle, %d",
 			     (u8)(buff->tail - buff->data));
 
@@ -551,7 +518,6 @@ static void _sdp_cm_path_complete(u64 id
 	 */
 	result = ib_send_cm_req(conn->cm_id, &param);
 	if (0 != result) {
-
 		sdp_dbg_warn(conn, "Error <%d> CM connect request", result);
 		goto failed;
 	}
@@ -562,7 +528,6 @@ failed:
 
 	result = sdp_wall_recv_reject(conn, (0 - status));
 	if (0 > result) {
-
 		sdp_dbg_warn(conn, "Error <%d> rejecting connection", result);
 		
 		expect = sdp_wall_recv_drop(conn);
@@ -588,7 +553,6 @@ int sdp_cm_connect(struct sdp_opt *conn)
 	 * get the buffer size we'll use for this connection. (and all others)
 	 */
 	if (sizeof(struct msg_hello) > conn->recv_size) {
-
 		sdp_dbg_warn(conn, "buffer size <%d> too small. <%Zu>",
 			     conn->recv_size, sizeof(struct msg_hello));
 		result = -ENOBUFS;
@@ -611,7 +575,6 @@ int sdp_cm_connect(struct sdp_opt *conn)
 	SDP_CONN_LOCK(conn);
 
 	if (0 > result) {
-
 		sdp_dbg_warn(conn, "Error <%d> getting link <%08x:%08x> addr",
 			     result,
 			     htonl(conn->dst_addr),




More information about the general mailing list