[openib-general] [PATCH][SDP][12/22] Whitespace cleanup in sdp_post.c

Tom Duffy Tom.Duffy at Sun.COM
Fri Feb 18 16:46:25 PST 2005


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

Index: linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_post.c
===================================================================
--- linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_post.c	(revision 1836)
+++ linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_post.c	(working copy)
@@ -43,17 +43,13 @@ int sdp_cm_listen_start(struct sdev_root
 
 	SDP_CHECK_NULL(dev_root, -EINVAL);
 
-	if (NULL != dev_root->listen_id) {
-
+	if (NULL != dev_root->listen_id)
 		sdp_dbg_warn(NULL, "Already listening for connections.");
-	}
 
 	dev_root->listen_id = ib_create_cm_id(sdp_cm_event_handler,
 					      (void *)SDP_DEV_SK_INVALID);
-	if (NULL == dev_root->listen_id) {
-
+	if (NULL == dev_root->listen_id)
 		return -ENOMEM;
-	}
 	/*
 	 * start listening
 	 */
@@ -61,17 +57,13 @@ int sdp_cm_listen_start(struct sdev_root
 		              cpu_to_be64(SDP_MSG_SERVICE_ID_VALUE),
 			      cpu_to_be64(SDP_MSG_SERVICE_ID_MASK));
 	if (0 > result) {
-
 		sdp_dbg_warn(NULL, "Error <%d> listening for SDP connections",
 			     result);
 
 		(void)ib_destroy_cm_id(dev_root->listen_id);
 		dev_root->listen_id = NULL;
-	}
-	else {
-
+	} else
 		sdp_dbg_init("Started listening for SDP connection requests");
-	}
 
 	return result;
 } /* sdp_cm_listen_start */
@@ -86,14 +78,10 @@ int sdp_cm_listen_stop(struct sdev_root 
 	SDP_CHECK_NULL(dev_root, -EINVAL);
 
 	result = ib_destroy_cm_id(dev_root->listen_id);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(NULL, "Error <%d> stopping listen", result);
-	}
-	else {
-
+	else
 		sdp_dbg_init("Stopped listening for SDP connections");
-	}
 
 	dev_root->listen_id = NULL;
 
@@ -109,7 +97,6 @@ static void _sdp_cm_disconnect(void *arg
 	int result;
 	
 	if (NULL == conn) {
-
 		sdp_dbg_warn(NULL, "Error, posting disconnect for NULL conn");
 		return;
 	}
@@ -119,10 +106,8 @@ static void _sdp_cm_disconnect(void *arg
 	 * send a disconnect request using the connection manager
 	 */
 	result = ib_send_cm_dreq(conn->cm_id, NULL, 0);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(NULL, "Error <%d> CM disconnect request", result);
-	}
 
 	SDP_CONN_PUT(conn);
 
@@ -137,10 +122,8 @@ static void _sdp_cm_reject(void *arg)
 	struct sdp_opt *conn = (struct sdp_opt *)arg;
 	int result;
 
-	if (NULL == conn) {
-
+	if (NULL == conn)
 		sdp_dbg_warn(NULL, "Error, posting reject for NULL conn");
-	}
 
 	sdp_dbg_ctrl(conn, "Defered reject <%08x>", conn->cm_id->local_id);
 	/*
@@ -149,10 +132,8 @@ static void _sdp_cm_reject(void *arg)
 	result = ib_send_cm_rej(conn->cm_id, 
 				IB_CM_REJ_CONSUMER_DEFINED,
 				NULL, 0, NULL, 0);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(NULL, "Error <%d> CM reject request", result);
-	}
 
 	SDP_CONN_PUT(conn);
 
@@ -167,20 +148,16 @@ static void _sdp_cm_confirm(void *arg)
 	struct sdp_opt *conn = (struct sdp_opt *)arg;
 	int result;
 
-	if (NULL == conn) {
-
+	if (NULL == conn)
 		sdp_dbg_warn(NULL, "Error, posting confirm for NULL conn");
-	}
 
 	sdp_dbg_ctrl(conn, "Defered confirm <%08x>", conn->cm_id->local_id);
 	/*
 	 * send a confirm request using the connection manager
 	 */
 	result = ib_send_cm_rtu(conn->cm_id, NULL, 0);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(NULL, "Error <%d> CM confirm request", result);
-	}
 
 	SDP_CONN_PUT(conn);
 
@@ -195,10 +172,8 @@ static void _sdp_cm_failed(void *arg)
 	struct sdp_opt *conn = (struct sdp_opt *)arg;
 	int result;
 
-	if (NULL == conn) {
-
+	if (NULL == conn)
 		sdp_dbg_warn(NULL, "Error, posting failed for NULL conn");
-	}
 
 	sdp_dbg_ctrl(conn, "Defered failed request <%08x>",
 		     conn->cm_id->local_id);
@@ -208,10 +183,8 @@ static void _sdp_cm_failed(void *arg)
 	result = ib_send_cm_rej(conn->cm_id, 
 				IB_CM_REJ_CONSUMER_DEFINED,
 				NULL, 0, NULL, 0);
-	if (0 > result) {
-	
+	if (0 > result)
 		sdp_dbg_warn(NULL, "Error <%d> CM failed request", result);
-	}
 
 	SDP_CONN_PUT(conn);
 
@@ -231,17 +204,10 @@ static int _sdp_cm_deferred_generic(stru
 	SDP_CONN_HOLD(conn);
 
 	if (in_atomic() || irqs_disabled()) {
-
-		INIT_WORK(&conn->cm_exec,
-			  defer_func,
-			  (void *)conn);
-    
+		INIT_WORK(&conn->cm_exec, defer_func, (void *)conn);
 		schedule_work(&conn->cm_exec);
-	}
-	else {
-
+	} else
 		defer_func(conn);
-	}
 
 	return 0;
 } /* _sdp_cm_deferred_generic */




More information about the general mailing list