[openib-general] [PATCH][SDP][4/22] Whitespace cleanup in sdp_conn.c

Tom Duffy Tom.Duffy at Sun.COM
Fri Feb 18 16:45:03 PST 2005


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

Index: linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_conn.c
===================================================================
--- linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_conn.c	(revision 1836)
+++ linux-2.6.10-openib/drivers/infiniband/ulp/sdp/sdp_conn.c	(working copy)
@@ -87,10 +87,8 @@ int sdp_inet_accept_q_put(struct sdp_opt
 	if (NULL != listen_conn->parent ||
 	    NULL != accept_conn->parent ||
 	    NULL == listen_conn->accept_next ||
-	    NULL == listen_conn->accept_prev) {
-
+	    NULL == listen_conn->accept_prev)
 		return -EFAULT;
-	}
 
 	next_conn = listen_conn->accept_next;
 
@@ -123,10 +121,8 @@ struct sdp_opt *sdp_inet_accept_q_get(st
 	    NULL == listen_conn->accept_next ||
 	    NULL == listen_conn->accept_prev ||
 	    listen_conn == listen_conn->accept_next ||
-	    listen_conn == listen_conn->accept_prev) {
-
+	    listen_conn == listen_conn->accept_prev)
 		return NULL;
-	}
 	/*
 	 * Return the next connection in the listening sockets accept
 	 * queue. The new connections lock is acquired, the caller must
@@ -162,10 +158,8 @@ int sdp_inet_accept_q_remove(struct sdp_
 
 	SDP_CHECK_NULL(accept_conn, -EINVAL);
 
-	if (NULL == accept_conn->parent) {
-
+	if (NULL == accept_conn->parent)
 		return -EFAULT;
-	}
 	/*
 	 * Removes the connection from the listening sockets accept queue.
 	 * The listning connections lock must be acquired to access the
@@ -201,7 +195,6 @@ int sdp_inet_listen_start(struct sdp_opt
 	SDP_CHECK_NULL(conn, -EINVAL);
 
 	if (SDP_SOCK_ST_CLOSED != conn->istate) {
-
 		sdp_dbg_warn(conn, "Incorrect connection state to listen.");
 		return -EBADFD;
 	}
@@ -220,10 +213,8 @@ int sdp_inet_listen_start(struct sdp_opt
 	_dev_root_s.listen_list = conn;
 	conn->lstn_p_next = &_dev_root_s.listen_list;
 
-	if (NULL != conn->lstn_next) {
-
+	if (NULL != conn->lstn_next)
 		conn->lstn_next->lstn_p_next = &conn->lstn_next;
-	}
 
 	spin_unlock_irqrestore(&_dev_root_s.listen_lock, flags);
 	return 0;
@@ -241,7 +232,6 @@ int sdp_inet_listen_stop(struct sdp_opt 
 	SDP_CHECK_NULL(listen_conn, -EINVAL);
 
 	if (SDP_SOCK_ST_LISTEN != listen_conn->istate) {
-
 		sdp_dbg_warn(listen_conn, "Incorrect state to stop listen.");
 		return -EBADFD;
 	}
@@ -254,9 +244,8 @@ int sdp_inet_listen_stop(struct sdp_opt 
 	/*
 	 * remove from listening list.
 	 */
-	if (NULL != listen_conn->lstn_next) {
+	if (NULL != listen_conn->lstn_next)
 		listen_conn->lstn_next->lstn_p_next = listen_conn->lstn_p_next;
-	}
 
 	*(listen_conn->lstn_p_next) = listen_conn->lstn_next;
 
@@ -277,11 +266,9 @@ int sdp_inet_listen_stop(struct sdp_opt 
 		accept_conn->istate = SDP_SOCK_ST_CLOSED;
 
 		result = sdp_wall_send_abort(accept_conn);
-		if (0 > result) {
-
+		if (0 > result)
 			sdp_dbg_warn(accept_conn, "Error <%d> during abort",
 				     result);
-		}
 
 		/* AcceptQueueGet */
 		SDP_CONN_UNLOCK(accept_conn);
@@ -310,15 +297,12 @@ struct sdp_opt *sdp_inet_listen_lookup(u
 	 * first find a listening connection
 	 */
 	for (conn = _dev_root_s.listen_list; NULL != conn;
-	     conn = conn->lstn_next) {
-
+	     conn = conn->lstn_next)
 		if (port == conn->src_port &&
 		    (INADDR_ANY == conn->src_addr || addr == conn->src_addr)) {
-
 			SDP_CONN_HOLD(conn);
 			break;
 		}
-	}
 
 	spin_unlock_irqrestore(&_dev_root_s.listen_lock, flags);
 	return conn;
@@ -351,10 +335,8 @@ int sdp_inet_port_get(struct sdp_opt *co
 	 * simple linked list of sockets ordered on local port number.
 	 */
 	if (0 < port) {
-
 		for (look = _dev_root_s.bind_list, port_ok = 1;
 		     NULL != look; look = look->bind_next) {
-
 			srch = look->sk;
 			/*
 			 * 1) same port
@@ -402,43 +384,32 @@ int sdp_inet_port_get(struct sdp_opt *co
 		}
 
 		if (0 == port_ok) {
-
 			result = -EADDRINUSE;
 			goto done;
 		}
-	}
-	else {
-
+	} else {
 		low_port = SDP_INET_PORT_LOW;
 		top_port = SDP_INET_PORT_HIGH;
 		rover = (0 > rover) ? low_port : rover;
 
 		for (counter = (top_port - low_port) + 1; counter > 0;
 		     counter--) {
-
 			rover++;
-			if (rover < low_port || rover > top_port) {
-
+			if (rover < low_port || rover > top_port)
 				rover = low_port;
-			}
 
 			for (look = _dev_root_s.bind_list;
 			     NULL != look && look->src_port != port;
-			     look = look->bind_next) {
-				/*
-				 * pass
-				 */
-			}
+			     look = look->bind_next)
+				do {} while(0); /* pass */
 
 			if (NULL == look) {
-
 				port = rover;
 				break;
 			}
 		}
 
 		if (0 == port) {
-
 			result = -EADDRINUSE;
 			goto done;
 		}
@@ -452,10 +423,8 @@ int sdp_inet_port_get(struct sdp_opt *co
 	_dev_root_s.bind_list = conn;
 	conn->bind_p_next = &_dev_root_s.bind_list;
 
-	if (NULL != conn->bind_next) {
-
+	if (NULL != conn->bind_next)
 		conn->bind_next->bind_p_next = &conn->bind_next;
-	}
 
 	result = 0;
 done:
@@ -472,10 +441,8 @@ int sdp_inet_port_put(struct sdp_opt *co
 
 	SDP_CHECK_NULL(conn, -EINVAL);
 
-	if (NULL == conn->bind_p_next) {
-
+	if (NULL == conn->bind_p_next)
 		return -EADDRNOTAVAIL;
-	}
 	/*
 	 * lock table
 	 */
@@ -483,9 +450,8 @@ int sdp_inet_port_put(struct sdp_opt *co
 	/*
 	 * remove from bind list.
 	 */
-	if (NULL != conn->bind_next) {
+	if (NULL != conn->bind_next)
 		conn->bind_next->bind_p_next = conn->bind_p_next;
-	}
 
 	*(conn->bind_p_next) = conn->bind_next;
 
@@ -515,7 +481,6 @@ int sdp_inet_port_inherit(struct sdp_opt
 
 	if (NULL != child->bind_p_next ||
 	    child->src_port != parent->src_port) {
-
 		sdp_dbg_warn(child, "child already bound. <%d:%d>",
 			     parent->src_port, child->src_port);
 		result = -EADDRNOTAVAIL;
@@ -528,10 +493,8 @@ int sdp_inet_port_inherit(struct sdp_opt
 	parent->bind_next = child;
 	child->bind_p_next = &parent->bind_next;
 
-	if (NULL != child->bind_next) {
-
+	if (NULL != child->bind_next)
 		child->bind_next->bind_p_next = &child->bind_next;
-	}
 
 	result = 0;
 done:
@@ -550,10 +513,8 @@ static int _sdp_conn_table_insert(struct
 
 	SDP_CHECK_NULL(conn, -EINVAL);
 
-	if (SDP_DEV_SK_INVALID != conn->hashent) {
-
+	if (SDP_DEV_SK_INVALID != conn->hashent)
 		return -ERANGE;
-	}
 	/*
 	 * lock table
 	 */
@@ -564,14 +525,10 @@ static int _sdp_conn_table_insert(struct
 	for (counter = 0;
 	     counter < _dev_root_s.sk_size;
 	     counter++, _dev_root_s.sk_rover++) {
-
-		if (!(_dev_root_s.sk_rover < _dev_root_s.sk_size)) {
-
+		if (!(_dev_root_s.sk_rover < _dev_root_s.sk_size))
 			_dev_root_s.sk_rover = 0;
-		}
 
 		if (NULL == _dev_root_s.sk_array[_dev_root_s.sk_rover]) {
-
 			_dev_root_s.sk_array[_dev_root_s.sk_rover] = conn;
 			_dev_root_s.sk_entry++;
 			conn->hashent = _dev_root_s.sk_rover;
@@ -607,14 +564,10 @@ int sdp_conn_table_remove(struct sdp_opt
 	/*
 	 * validate entry
 	 */
-	if (SDP_DEV_SK_INVALID == conn->hashent) {
-
+	if (SDP_DEV_SK_INVALID == conn->hashent)
 		goto done;
-	}
-
-	if (0 > conn->hashent ||
-	    conn != _dev_root_s.sk_array[conn->hashent]) {
 
+	if (0 > conn->hashent || conn != _dev_root_s.sk_array[conn->hashent]) {
 		result = -ERANGE;
 		goto done;
 	}
@@ -656,10 +609,8 @@ struct sdp_opt *sdp_conn_table_lookup(s3
 #endif
 
 	conn = _dev_root_s.sk_array[entry];
-	if (NULL == conn) {
-
+	if (NULL == conn)
 		goto done;
-	}
 
 	SDP_CONN_HOLD(conn);
 done:
@@ -680,7 +631,6 @@ int sdp_conn_destruct(struct sdp_opt *co
 	int dump = 0;
 
 	if (NULL == conn) {
-
 		sdp_dbg_warn(NULL, "sk destruct, no connection!");
 		result = -EINVAL;
 		goto done;
@@ -698,12 +648,10 @@ int sdp_conn_destruct(struct sdp_opt *co
 	 * remove connection from table
 	 */
 	result = sdp_conn_table_remove(conn);
-	if (0 > result) {
-
+	if (0 > result)
 		sdp_dbg_warn(conn, "Error <%d> removing connection <%u:%u>",
 			     result, _dev_root_s.sk_entry,
 			     _dev_root_s.sk_size);
-	}
 
 	result = __sdp_conn_stat_dump(conn);
 	SDP_EXPECT(!(0 > result));
@@ -747,10 +695,8 @@ int sdp_conn_destruct(struct sdp_opt *co
 	 * If the QP owner is not the CM, then destroy.
 	 */
 	if (conn->qp) {
-
 		result = ib_destroy_qp(conn->qp);
 		if (0 > result && -EINVAL != result) {
-
 			sdp_dbg_warn(conn, "Error <%d> detroying QP", result);
 			dump++;
 		}
@@ -759,10 +705,8 @@ int sdp_conn_destruct(struct sdp_opt *co
 	 * destroy CQs
 	 */
 	if (conn->recv_cq) {
-
 		result = ib_destroy_cq(conn->recv_cq);
 		if (0 > result && -EINVAL != result) {
-
 			sdp_dbg_warn(conn, "Error <%d> detroying recv CQ",
 				     result);
 			dump++;
@@ -770,10 +714,8 @@ int sdp_conn_destruct(struct sdp_opt *co
 	}
 
 	if (conn->send_cq) {
-
 		result = ib_destroy_cq(conn->send_cq);
 		if (0 > result && -EINVAL != result) {
-
 			sdp_dbg_warn(conn, "Error <%d> detroying send CQ",
 				     result);
 			dump++;
@@ -783,33 +725,25 @@ int sdp_conn_destruct(struct sdp_opt *co
 	 * in case CM/IB are still tracking this connection.
 	 */
 	if (conn->cm_id) {
-
 		sdp_dbg_warn(conn, "CM local id <%d>", conn->cm_id->local_id);
 
 		result = ib_destroy_cm_id(conn->cm_id);
-		if (result) {
-
+		if (result)
 			sdp_dbg_warn(conn, "Error <%d> detroying CM ID",
 				     result);
-		}
 	}
 	/*
 	 * check consistancy
 	 */
-	if (0 > atomic_read(&conn->refcnt)) {
-
+	if (0 > atomic_read(&conn->refcnt))
 		sdp_dbg_warn(conn, "destruct low ref count <%04x>",
 			     atomic_read(&conn->refcnt));
-	}
 	/*
 	 * free the OS socket structure
 	 */
-	if (NULL == conn->sk) {
-
+	if (NULL == conn->sk)
 		sdp_dbg_warn(conn, "destruct, no socket! continuing.");
-	}
 	else {
-
 		sk_free(conn->sk);
 		conn->sk = NULL;
 	}
@@ -820,7 +754,6 @@ int sdp_conn_destruct(struct sdp_opt *co
 done:
 
 	if (0 != dump) {
-
 		result = __sdp_conn_state_dump(conn);
 		SDP_EXPECT(!(0 > result));
 	}
@@ -844,10 +777,8 @@ void sdp_conn_internal_lock(struct sdp_o
 		spin_lock_irqsave(&(conn->lock.slock), f);
 		*flags = f;
 
-		if (0 == conn->lock.users) {
-
+		if (0 == conn->lock.users)
 			break;
-		}
 	}
 
 	current->state = TASK_RUNNING;
@@ -868,68 +799,48 @@ void sdp_conn_internal_relock(struct sdp
 	int rearm = 1;
 
 	while (1) {
-
 		result_r = ib_poll_cq(conn->recv_cq, 1, &entry);
 		if (1 == result_r) {
-			
 			result = sdp_cq_event_locked(&entry, conn);
-			if (0 > result) {
-
+			if (0 > result)
 				sdp_dbg_warn(conn, 
 					     "Error <%d> from event handler.",
 					     result);
-			}
 
 			rearm = 1;
 		}
 
 		result_s = ib_poll_cq(conn->send_cq, 1, &entry);
 		if (1 == result_s) {
-
 			result = sdp_cq_event_locked(&entry, conn);
-			if (0 > result) {
-
+			if (0 > result)
 				sdp_dbg_warn(conn, 
 					     "Error <%d> from event handler.",
 					     result);
-			}
-
 			rearm = 1;
 		}
 
-		if (0 != result_r || 0 != result_s) {
-
+		if (0 != result_r || 0 != result_s)
 			continue;
-		}
 
 		if (0 < rearm) {
-
 			result = ib_req_notify_cq(conn->recv_cq,
 						  IB_CQ_NEXT_COMP);
-			if (result) {
-				
+			if (result)
 				sdp_dbg_warn(conn, 
 					     "Error <%d> rearming recv CQ",
 					     result);
-			}
 
 			result = ib_req_notify_cq(conn->send_cq,
 						  IB_CQ_NEXT_COMP);
-			if (result) {
-				
+			if (result)
 				sdp_dbg_warn(conn, 
 					     "Error <%d> rearming send CQ",
 					     result);
-			}
 			
 			rearm = 0;
-		}
-		else {
-				/*
-				 * exit CQ handler routine.
-				 */
-			break;
-		}
+		} else
+			break;  /* exit CQ handler routine */
 	}
 
 	conn->flags &= ~SDP_CONN_F_MASK_EVENT;
@@ -961,11 +872,9 @@ int sdp_conn_cq_drain(struct ib_cq *cq, 
 			 * to be armed.
 			 */
 			result = sdp_cq_event_locked(&entry, conn);
-			if (0 > result) {
-
+			if (0 > result)
 				sdp_dbg_warn(conn, "Error <%d> event handler.",
 					     result);
-			}
 
 			rearm = 1;
 			calls++;
@@ -974,33 +883,18 @@ int sdp_conn_cq_drain(struct ib_cq *cq, 
 		}
 
 		if (!result) {
-
 			if (0 < rearm) {
-
 				result = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
-				if (result) {
-
+				if (result)
 					sdp_dbg_warn(conn, 
 						     "Error <%d> rearming CQ",
 						     result);
-				}
-
 				rearm = 0;
-			}
-			else {
-				/*
-				 * exit CQ handler routine.
-				 */
-				break;
-			}
-		}
-		else {
-			/*
-			 * unexpected CQ error
-			 */
+			} else
+				break; /* exit CQ handler routine */
+		} else
 			sdp_dbg_warn(conn, "Unexpected error <%d> from CQ",
 				     result);
-		}
 	}
 
 return calls;
@@ -1016,16 +910,11 @@ void sdp_conn_internal_unlock(struct sdp
 	 * poll CQs for events.
 	 */
 	if (NULL != conn) {
-
-		if (0 < (SDP_CONN_F_RECV_CQ_PEND & conn->flags)) {
-
+		if (0 < (SDP_CONN_F_RECV_CQ_PEND & conn->flags))
 			calls += sdp_conn_cq_drain(conn->recv_cq, conn);
-		}
-
-		if (0 < (SDP_CONN_F_SEND_CQ_PEND & conn->flags)) {
 
+		if (0 < (SDP_CONN_F_SEND_CQ_PEND & conn->flags))
 			calls += sdp_conn_cq_drain(conn->send_cq, conn);
-		}
 
 		conn->flags &= ~SDP_CONN_F_MASK_EVENT;
 	}
@@ -1067,35 +956,29 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 	 * look up correct HCA and port
 	 */
 	hca = ib_get_client_data(device, &sdp_client);
-	if (!hca) {
+	if (!hca)
 		return -ERANGE;
-	}
 
-	for (port = hca->port_list; NULL != port; port = port->next) {
-		if (hw_port == port->index) {
+	for (port = hca->port_list; NULL != port; port = port->next)
+		if (hw_port == port->index)
 			break;
-		}
-	}
 
-	if (!port) {
+	if (!port)
 		return -ERANGE;
-	}
 	/*
 	 * allocate creation parameters
 	 */
 	qp_attr = kmalloc(sizeof(*qp_attr),  GFP_KERNEL);
 	if (NULL == qp_attr) {
-		
 		result = -ENOMEM;
 		goto error_attr;
-	} /* if */
+	}
   
 	init_attr = kmalloc(sizeof(*init_attr), GFP_KERNEL);
 	if (NULL == init_attr) {
-		
 		result = -ENOMEM;
 		goto error_param;
-	} /* if */
+	}
 	
 	memset(qp_attr,   0, sizeof(*qp_attr));
 	memset(init_attr, 0, sizeof(*init_attr));
@@ -1113,14 +996,12 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 	 * allocate IB CQ's and QP
 	 */
 	if (!conn->send_cq) {
-
 		conn->send_cq = ib_create_cq(conn->ca,
 					     sdp_cq_event_handler,
 					     NULL,
 					     __hashent_arg(conn->hashent),
 					     conn->send_cq_size);
 		if (IS_ERR(conn->send_cq)) {
-
 			result = PTR_ERR(conn->send_cq);
 			sdp_dbg_warn(conn, "Error <%d> creating send CQ <%d>",
 				     result, conn->send_cq_size);
@@ -1131,7 +1012,6 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 
 		result = ib_req_notify_cq(conn->send_cq, IB_CQ_NEXT_COMP);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> arming send CQ.",
 				     result);
 			goto error_rcq;
@@ -1146,7 +1026,6 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 					     conn->recv_cq_size);
 
 		if (IS_ERR(conn->recv_cq)) {
-
 			result = PTR_ERR(conn->recv_cq);
 			sdp_dbg_warn(conn, "Error <%d> creating recv CQ <%d>",
 				     result, conn->recv_cq_size);
@@ -1157,7 +1036,6 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 
 		result = ib_req_notify_cq(conn->recv_cq, IB_CQ_NEXT_COMP);
 		if (0 > result) {
-
 			sdp_dbg_warn(conn, "Error <%d> arming recv CQ.",
 				     result);
 			goto error_qp;
@@ -1165,7 +1043,6 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 	}
 
 	if (!conn->qp) {
-
 		init_attr->cap.max_send_wr  = conn->send_cq_size;
 		init_attr->cap.max_recv_wr  = conn->recv_cq_size;
 		init_attr->cap.max_send_sge = SDP_QP_LIMIT_SG_SEND;
@@ -1181,7 +1058,6 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 
 		conn->qp = ib_create_qp(conn->pd, init_attr);
 		if (IS_ERR(conn->qp)) {
-
 			result = PTR_ERR(conn->qp);
 			sdp_dbg_warn(conn, "Error <%d> creating QP", result);
 
@@ -1197,7 +1073,6 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 					     pkey,
 					     &qp_attr->pkey_index);
 		if (result) {
-
 			sdp_dbg_warn(conn, "Error <%d> find pkey index <%04x>",
 				     result, pkey);
 			goto error_mod;
@@ -1216,7 +1091,6 @@ int sdp_conn_alloc_ib(struct sdp_opt *co
 		result = ib_modify_qp(conn->qp, qp_attr, attr_mask);
 
 		if (0 != result) {
-
 			sdp_dbg_warn(conn, "Error <%d> modifying QP", result);
 			goto error_mod;
 		}
@@ -1254,7 +1128,6 @@ struct sdp_opt *sdp_conn_alloc(int prior
 
 	sk = sk_alloc(_dev_root_s.proto, priority, 1, _dev_root_s.sock_cache);
 	if (NULL == sk) {
-
 		sdp_dbg_warn(NULL, "socket alloc error for protocol. <%d:%d>",
 			     _dev_root_s.proto, priority);
 		return NULL;
@@ -1283,7 +1156,6 @@ struct sdp_opt *sdp_conn_alloc(int prior
 	 */
 	conn = kmem_cache_alloc(_dev_root_s.conn_cache, priority);
 	if (NULL == conn) {
-
 		sdp_dbg_warn(conn, "connection alloc error. <%d>", priority);
 		result = -ENOMEM;
 		goto error;
@@ -1496,7 +1368,6 @@ int sdp_proc_dump_conn_main(char *buffer
 	 * header should only be printed once
 	 */
 	if (0 == start_index) {
-
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_MAIN_HEAD);
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_MAIN_SEP);
 	}
@@ -1507,10 +1378,8 @@ int sdp_proc_dump_conn_main(char *buffer
 	/*
 	 * if the entire table has been walked, exit.
 	 */
-	if (!(start_index < _dev_root_s.sk_size)) {
-
+	if (!(start_index < _dev_root_s.sk_size))
 		goto done;
-	}
 	/*
 	 * loop across connections.
 	 */
@@ -1518,11 +1387,8 @@ int sdp_proc_dump_conn_main(char *buffer
 	     counter < _dev_root_s.sk_size &&
 		     !(SDP_CONN_PROC_MAIN_SIZE > (max_size - offset));
 	     counter++) {
-
-		if (NULL == _dev_root_s.sk_array[counter]) {
-
+		if (NULL == _dev_root_s.sk_array[counter])
 			continue;
-		}
 
 		conn = _dev_root_s.sk_array[counter];
 
@@ -1610,7 +1476,6 @@ int sdp_proc_dump_conn_data(char *buffer
 	 * header should only be printed once
 	 */
 	if (0 == start_index) {
-
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_DATA_HEAD);
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_DATA_SEP);
 	}
@@ -1621,21 +1486,16 @@ int sdp_proc_dump_conn_data(char *buffer
 	/*
 	 * if the entire table has been walked, exit.
 	 */
-	if (!(start_index < _dev_root_s.sk_size)) {
-
+	if (!(start_index < _dev_root_s.sk_size))
 		goto done;
-	}
 	/*
 	 * loop across connections.
 	 */
 	for (counter = start_index; counter < _dev_root_s.sk_size &&
 		     !(SDP_CONN_PROC_DATA_SIZE > (max_size - offset));
 	     counter++) {
-
-		if (NULL == _dev_root_s.sk_array[counter]) {
-
+		if (NULL == _dev_root_s.sk_array[counter])
 			continue;
-		}
 
 		conn = _dev_root_s.sk_array[counter];
 		sk = conn->sk;
@@ -1715,7 +1575,6 @@ int sdp_proc_dump_conn_rdma(char *buffer
 	 * header should only be printed once
 	 */
 	if (0 == start_index) {
-
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_RDMA_HEAD);
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_RDMA_SEP);
 	}
@@ -1726,21 +1585,16 @@ int sdp_proc_dump_conn_rdma(char *buffer
 	/*
 	 * if the entire table has been walked, exit.
 	 */
-	if (!(start_index < _dev_root_s.sk_size)) {
-
+	if (!(start_index < _dev_root_s.sk_size))
 		goto done;
-	}
 	/*
 	 * loop across connections.
 	 */
 	for (counter = start_index; counter < _dev_root_s.sk_size &&
 		     !(SDP_CONN_PROC_RDMA_SIZE > (max_size - offset));
 	     counter++) {
-
-		if (NULL == _dev_root_s.sk_array[counter]) {
-
+		if (NULL == _dev_root_s.sk_array[counter])
 			continue;
-		}
 
 		conn = _dev_root_s.sk_array[counter];
 
@@ -1803,7 +1657,6 @@ int sdp_proc_dump_conn_sopt(char *buffer
 	 * header should only be printed once
 	 */
 	if (0 == start_index) {
-
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_SOPT_HEAD);
 		offset += sprintf((buffer + offset), SDP_PROC_CONN_SOPT_SEP);
 	}
@@ -1814,21 +1667,16 @@ int sdp_proc_dump_conn_sopt(char *buffer
 	/*
 	 * if the entire table has been walked, exit.
 	 */
-	if (!(start_index < _dev_root_s.sk_size)) {
-
+	if (!(start_index < _dev_root_s.sk_size))
 		goto done;
-	}
 	/*
 	 * loop across connections.
 	 */
 	for (counter = start_index; counter < _dev_root_s.sk_size &&
 		     !(SDP_SOPT_PROC_DUMP_SIZE > (max_size - offset));
 	     counter++) {
-
-		if (NULL == _dev_root_s.sk_array[counter]) {
-
+		if (NULL == _dev_root_s.sk_array[counter])
 			continue;
-		}
 
 		conn = _dev_root_s.sk_array[counter];
 
@@ -1872,7 +1720,6 @@ int sdp_proc_dump_device(char *buffer,
 	 * header should only be printed once
 	 */
 	if (0 == start_index) {
-
 		offset += sprintf((buffer + offset),
 				  "connection table maximum: <%d>\n",
 				  _dev_root_s.sk_size);
@@ -1922,8 +1769,6 @@ static void sdp_device_init_one(struct i
 	 */
 	hca = kmalloc(sizeof(struct sdev_hca), GFP_KERNEL);
 	if (NULL == hca) {
-
-		
 		sdp_warn("Error allocating HCA <%s> memory.", device->name);
 		return;
 	}
@@ -1941,7 +1786,6 @@ static void sdp_device_init_one(struct i
 	 */
 	hca->pd = ib_alloc_pd(hca->ca);
 	if (IS_ERR(hca->pd)) {
-
 		sdp_warn("Error <%ld> creating HCA <%s> protection domain.",
 			 PTR_ERR(hca->pd), device->name);
 		goto error;
@@ -1951,7 +1795,6 @@ static void sdp_device_init_one(struct i
 	 */
 	hca->mem_h = ib_get_dma_mr(hca->pd, IB_ACCESS_LOCAL_WRITE);
 	if (IS_ERR(hca->mem_h)) {
-
 		sdp_warn("Error <%ld> registering HCA <%s> memory.",
 			 PTR_ERR(hca->mem_h), device->name);
 		goto error;
@@ -1977,7 +1820,6 @@ static void sdp_device_init_one(struct i
 #ifdef _FMR_SUPPORT
 	hca->fmr_pool = ib_create_fmr_pool(hca->pd, &fmr_param_s);
 	if (IS_ERR(hca->fmr_pool)) {
-
 		sdp_warn("Error <%ld> creating HCA <%s> fast memory pool",
 			 PTR_ERR(hca->fmr_pool), device->name);
 		goto error;
@@ -1989,10 +1831,8 @@ static void sdp_device_init_one(struct i
 	for (port_count = 0; 
 	     port_count < device->phys_port_cnt;
 	     port_count++) {
-
 		port = kmalloc(sizeof(struct sdev_hca_port), GFP_KERNEL);
 		if (NULL == port) {
-
 			sdp_warn("Error allocating HCA <%s> port <%d:%d>",
 				 device->name, port_count,
 				 device->phys_port_cnt);
@@ -2011,7 +1851,6 @@ static void sdp_device_init_one(struct i
 				      0,	/* index */
 				      &port->gid);
 		if (0 != result) {
-
 			sdp_warn("Error <%d> getting GID for HCA <%s:%d:%d>",
 				 result, device->name,
 				 port->index, device->phys_port_cnt);
@@ -2025,7 +1864,6 @@ static void sdp_device_init_one(struct i
 
 error:
 	while (NULL != hca->port_list) {
-			 
 		port = hca->port_list;
 		hca->port_list = port->next;
 		port->next = NULL;
@@ -2057,13 +1895,11 @@ static void sdp_device_remove_one(struct
 	hca = ib_get_client_data(device, &sdp_client);
 
 	if (NULL == hca) {
-
 		sdp_warn("Device <%s> has no HCA info.", device->name);
 		return;
 	}
 	
 	while (NULL != hca->port_list) {
-			 
 		port = hca->port_list;
 		hca->port_list = port->next;
 		port->next = NULL;
@@ -2131,7 +1967,6 @@ int sdp_conn_table_init(int proto_family
 	 */
 	result = ib_register_client(&sdp_client);
 	if (0 > result) {
-
 		sdp_warn("Error <%d> registering SDP client.", result);
 		goto error_hca;
 	}
@@ -2139,7 +1974,6 @@ int sdp_conn_table_init(int proto_family
 	 * create socket table
 	 */
 	if (!(0 < conn_size)) {
-
 		sdp_warn("Invalid connection table size. <%d>", conn_size);
 		result = -EINVAL;
 		goto error_size;
@@ -2153,7 +1987,6 @@ int sdp_conn_table_init(int proto_family
 	_dev_root_s.sk_array = (void *) __get_free_pages(GFP_KERNEL,
 						       _dev_root_s.sk_ordr);
 	if (NULL == _dev_root_s.sk_array) {
-
 		sdp_warn("Failed to create connection table. <%d:%d:%d>",
 			 byte_size, page_size, _dev_root_s.sk_ordr);
 		result = -ENOMEM;
@@ -2170,7 +2003,6 @@ int sdp_conn_table_init(int proto_family
 	 */
 	result = sdp_main_iocb_init();
 	if (0 > result) {
-
 		sdp_warn("Error <%d> initializing SDP IOCB table.", result);
 		goto error_iocb;
 	}
@@ -2180,7 +2012,6 @@ int sdp_conn_table_init(int proto_family
 						   0, SLAB_HWCACHE_ALIGN,
 						   NULL, NULL);
 	if (NULL == _dev_root_s.conn_cache) {
-
 		sdp_warn("Failed to initialize connection cache.");
 		result = -ENOMEM;
 		goto error_conn;
@@ -2191,7 +2022,6 @@ int sdp_conn_table_init(int proto_family
 						   0, SLAB_HWCACHE_ALIGN,
 						   NULL, NULL);
         if (NULL == _dev_root_s.sock_cache) {
-
 		sdp_warn("Failed to initialize sock cache.");
 		result = -ENOMEM;
 		goto error_sock;
@@ -2202,7 +2032,6 @@ int sdp_conn_table_init(int proto_family
 	 */
 	result = sdp_cm_listen_start(&_dev_root_s);
 	if (0 > result) {
-
 		sdp_warn("Error <%d> listening for connections on HCA.",
 			 result);
 		goto error_listen;




More information about the general mailing list