[openib-general] [PATCH][SDP][7/33] Fix comment style in sdp_conn.c

Tom Duffy Tom.Duffy at Sun.COM
Thu Feb 17 14:09:41 PST 2005


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

--- drivers/infiniband/ulp/sdp-orig/sdp_conn.c	2005-02-14 12:51:45.936001000 -0800
+++ drivers/infiniband/ulp/sdp/sdp_conn.c	2005-02-17 10:38:44.836003000 -0800
@@ -1,25 +1,36 @@
 /*
-  This software is available to you under a choice of one of two
-  licenses.  You may choose to be licensed under the terms of the GNU
-  General Public License (GPL) Version 2, available at
-  <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD
-  license, available in the LICENSE.TXT file accompanying this
-  software.  These details are also available at
-  <http://openib.org/license.html>.
-
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-  SOFTWARE.
-
-  Copyright (c) 2005 Topspin Communications.  All rights reserved.
-
-  $Id: sdp_conn.c 1032 2004-10-20 23:17:34Z roland $
-*/
+ * Copyright (c) 2005 Topspin Communications.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id$
+ */
 
 #include "sdp_main.h"
 
@@ -37,13 +48,13 @@ static struct ib_client sdp_client = {
 static spinlock_t psn_lock = SPIN_LOCK_UNLOCKED;
 static u32        psn_seed;
 
-/* --------------------------------------------------------------------- */
-/*                                                                       */
-/* module specific functions                                             */
-/*                                                                       */
-/* --------------------------------------------------------------------- */
-/* ========================================================================= */
-/*..sdp_psn_generate -- generate a PSN for connection management. */
+/*
+ * module specific functions
+ */
+
+/*
+ * sdp_psn_generate - generate a PSN for connection management.
+ */
 static u32 _sdp_psn_generate(void)
 {
         u32 psn;
@@ -62,8 +73,9 @@ static u32 _sdp_psn_generate(void)
         return psn;
 } /* sdp_psn_generate */
 
-/* ========================================================================= */
-/*..sdp_inet_accept_q_put -- put a conn into a listen conn's accept Q. */
+/*
+ * sdp_inet_accept_q_put - put a conn into a listen conn's accept Q.
+ */
 int sdp_inet_accept_q_put(struct sdp_opt *listen_conn,
 			  struct sdp_opt *accept_conn)
 {
@@ -97,8 +109,9 @@ int sdp_inet_accept_q_put(struct sdp_opt
 	return 0;
 } /* sdp_inet_accept_q_put */
 
-/* ========================================================================= */
-/*..sdp_inet_accept_q_get -- get a conn from a listen conn's accept Q. */
+/*
+ * sdp_inet_accept_q_get - get a conn from a listen conn's accept Q.
+ */
 struct sdp_opt *sdp_inet_accept_q_get(struct sdp_opt *listen_conn)
 {
 	struct sdp_opt *prev_conn;
@@ -139,8 +152,9 @@ struct sdp_opt *sdp_inet_accept_q_get(st
 	return accept_conn;
 } /* sdp_inet_accept_q_get */
 
-/* ========================================================================= */
-/*..sdp_inet_accept_q_remove -- remove a conn from a conn's accept Q. */
+/*
+ * sdp_inet_accept_q_remove - remove a conn from a conn's accept Q.
+ */
 int sdp_inet_accept_q_remove(struct sdp_opt *accept_conn)
 {
 	struct sdp_opt *next_conn;
@@ -177,8 +191,9 @@ int sdp_inet_accept_q_remove(struct sdp_
 	return 0;
 } /* sdp_inet_accept_q_remove */
 
-/* ========================================================================= */
-/*..sdp_inet_listen_start -- start listening for new connections on a socket */
+/*
+ * sdp_inet_listen_start - start listening for new connections on a socket
+ */
 int sdp_inet_listen_start(struct sdp_opt *conn)
 {
 	unsigned long flags;
@@ -214,8 +229,9 @@ int sdp_inet_listen_start(struct sdp_opt
 	return 0;
 } /* sdp_inet_listen_start */
 
-/* ========================================================================= */
-/*..sdp_inet_listen_stop -- stop listening for new connections on a socket */
+/*
+ * sdp_inet_listen_stop - stop listening for new connections on a socket
+ */
 int sdp_inet_listen_stop(struct sdp_opt *listen_conn)
 {
 	struct sdp_opt *accept_conn;
@@ -279,8 +295,9 @@ int sdp_inet_listen_stop(struct sdp_opt 
 	return 0;
 } /* sdp_inet_listen_stop */
 
-/* ========================================================================= */
-/*..sdp_inet_listen_lookup -- lookup a connection in the listen list */
+/*
+ * sdp_inet_listen_lookup - lookup a connection in the listen list
+ */
 struct sdp_opt *sdp_inet_listen_lookup(u32 addr, u16 port)
 {
 	struct sdp_opt *conn;
@@ -307,8 +324,9 @@ struct sdp_opt *sdp_inet_listen_lookup(u
 	return conn;
 } /* sdp_inet_listen_lookup */
 
-/* ========================================================================= */
-/*..sdp_inet_port_get -- bind a socket to a port. */
+/*
+ * sdp_inet_port_get - bind a socket to a port.
+ */
 int sdp_inet_port_get(struct sdp_opt *conn, u16 port)
 {
 	struct sock *sk;
@@ -341,7 +359,8 @@ int sdp_inet_port_get(struct sdp_opt *co
 			/*
 			 * 1) same port
 			 * 2) linux force reuse is off.
-			 * 3) same bound interface, or neither has a bound interface
+			 * 3) same bound interface, or neither has a bound
+			 *    interface
 			 */
 			if (look->src_port == port &&
 			    !(1 < sk->sk_reuse) &&
@@ -356,8 +375,10 @@ int sdp_inet_port_get(struct sdp_opt *co
 				    0 == srch->sk_reuse ||
 				    SDP_SOCK_ST_LISTEN == look->istate) {
 					/*
-					 * 5) neither socket is using a specific address
-					 * 6) both sockets are trying for the same interface.
+					 * 5) neither socket is using a
+					 *    specific address
+					 * 6) both sockets are trying for the
+					 *    same interface.
 					 */
 					if (INADDR_ANY == conn->src_addr ||
 					    INADDR_ANY == look->src_addr ||
@@ -442,8 +463,9 @@ done:
 	return result;
 } /* sdp_inet_port_get */
 
-/* ========================================================================= */
-/*..sdp_inet_port_put -- unbind a socket from a port. */
+/*
+ * sdp_inet_port_put - unbind a socket from a port.
+ */
 int sdp_inet_port_put(struct sdp_opt *conn)
 {
 	unsigned long flags;
@@ -475,8 +497,9 @@ int sdp_inet_port_put(struct sdp_opt *co
 	return 0;
 } /* sdp_inet_port_put */
 
-/* ========================================================================= */
-/*..sdp_inet_port_inherit -- inherit a port from another socket (accept) */
+/*
+ * sdp_inet_port_inherit - inherit a port from another socket (accept)
+ */
 int sdp_inet_port_inherit(struct sdp_opt *parent, struct sdp_opt *child)
 {
 	int result;
@@ -516,8 +539,9 @@ done:
 	return result;
 } /* sdp_inet_port_inherit */
 
-/* ========================================================================= */
-/*..sdp_conn_table_insert -- insert a connection into the connection table */
+/*
+ * sdp_conn_table_insert - insert a connection into the connection table
+ */
 int sdp_conn_table_insert(struct sdp_opt *conn)
 {
 	u32 counter;
@@ -567,8 +591,9 @@ int sdp_conn_table_insert(struct sdp_opt
 	return result;
 } /* sdp_conn_table_insert */
 
-/* ========================================================================= */
-/*..sdp_conn_table_remove -- remove a connection from the connection table */
+/*
+ * sdp_conn_table_remove - remove a connection from the connection table
+ */
 int sdp_conn_table_remove(struct sdp_opt *conn)
 {
 	int result = 0;
@@ -608,8 +633,9 @@ done:
 	return result;
 } /* sdp_conn_table_remove */
 
-/* ========================================================================= */
-/*..sdp_conn_table_lookup -- look up connection in the connection table */
+/*
+ * sdp_conn_table_lookup - look up connection in the connection table
+ */
 struct sdp_opt *sdp_conn_table_lookup(s32 entry)
 {
 	struct sdp_opt *conn;
@@ -641,13 +667,13 @@ done:
 	return conn;
 } /* sdp_conn_table_lookup */
 
-/* --------------------------------------------------------------------- */
-/*                                                                       */
-/* connection allocation/deallocation                                    */
-/*                                                                       */
-/* --------------------------------------------------------------------- */
-/* ========================================================================= */
-/*..sdp_conn_destruct -- final destructor for connection. */
+/*
+ * connection allocation/deallocation
+ */
+
+/*
+ * sdp_conn_destruct - final destructor for connection.
+ */
 int sdp_conn_destruct(struct sdp_opt *conn)
 {
 	int result = 0;
@@ -802,8 +828,9 @@ done:
 	return result;
 } /* _sdp_conn_destruct */
 
-/* ========================================================================= */
-/*..sdp_conn_internal_lock -- lock the connection (use only from macro) */
+/*
+ * sdp_conn_internal_lock - lock the connection (use only from macro)
+ */
 void sdp_conn_internal_lock(struct sdp_opt *conn, unsigned long *flags)
 {
 	DECLARE_WAITQUEUE(wait, current);
@@ -829,8 +856,9 @@ void sdp_conn_internal_lock(struct sdp_o
 	return;
 } /* sdp_conn_internal_lock */
 
-/* ========================================================================= */
-/*..sdp_conn_internal_relock -- test the connection (use only from macro) */
+/*
+ * sdp_conn_internal_relock - test the connection (use only from macro)
+ */
 void sdp_conn_internal_relock(struct sdp_opt *conn)
 {
 	struct ib_wc entry;
@@ -909,8 +937,9 @@ void sdp_conn_internal_relock(struct sdp
 	return;
 } /* sdp_conn_internal_relock */
 
-/* ========================================================================= */
-/*..sdp_conn_cq_drain -- drain one of the the connection's CQs */
+/*
+ * sdp_conn_cq_drain - drain one of the the connection's CQs
+ */
 int sdp_conn_cq_drain(struct ib_cq *cq, struct sdp_opt *conn)
 {
 	struct ib_wc entry;
@@ -977,8 +1006,9 @@ int sdp_conn_cq_drain(struct ib_cq *cq, 
 return calls;
 } /* sdp_conn_cq_drain */
 
-/* ========================================================================= */
-/*..sdp_conn_internal_unlock -- lock the connection (use only from macro) */
+/*
+ * sdp_conn_internal_unlock - lock the connection (use only from macro)
+ */
 void sdp_conn_internal_unlock(struct sdp_opt *conn)
 {
 	int calls = 0;
@@ -1003,8 +1033,9 @@ void sdp_conn_internal_unlock(struct sdp
 	return;
 } /* sdp_conn_internal_unlock */
 
-/* ========================================================================= */
-/*.._sdp_conn_lock_init -- initialize connection lock */
+/*
+ * _sdp_conn_lock_init - initialize connection lock
+ */
 static int _sdp_conn_lock_init(struct sdp_opt *conn)
 {
 	SDP_CHECK_NULL(conn, -EINVAL);
@@ -1016,8 +1047,9 @@ static int _sdp_conn_lock_init(struct sd
 	return 0;
 } /* _sdp_conn_lock_init */
 
-/* ========================================================================= */
-/*..sdp_conn_alloc_ib -- allocate IB structures for a new connection. */
+/*
+ * sdp_conn_alloc_ib - allocate IB structures for a new connection.
+ */
 int sdp_conn_alloc_ib(struct sdp_opt *conn,
 		      struct ib_device *device,
 		      u8 hw_port,
@@ -1211,8 +1243,9 @@ error_attr:
 	return result;
 } /* sdp_conn_alloc_ib  */
 
-/* ========================================================================= */
-/*..sdp_conn_alloc -- allocate a new socket, and init. */
+/*
+ * sdp_conn_alloc - allocate a new socket, and init.
+ */
 struct sdp_opt *sdp_conn_alloc(int priority)
 {
 	struct sdp_opt *conn;
@@ -1420,11 +1453,9 @@ error:
 	return NULL;
 } /* sdp_conn_alloc  */
 
-/* --------------------------------------------------------------------- */
-/*                                                                       */
-/* module public functions                                               */
-/*                                                                       */
-/* --------------------------------------------------------------------- */
+/*
+ * module public functions
+ */
 
 #define SDP_CONN_PROC_MAIN_SIZE  183 /* output line size. */
 #define SDP_PROC_CONN_MAIN_HEAD \
@@ -1442,8 +1473,9 @@ error:
 	"%04x %08x %04x %08x%08x %08x%08x %04x %04x "         \
 	"%06x %06x %08x%08x %08x%08x %08x%08x %08x%08x %08x %08x\n"
 
-/* ========================================================================= */
-/*..sdp_proc_dump_conn_main - dump the connection table to /proc */
+/*
+ * sdp_proc_dump_conn_main - dump the connection table to /proc
+ */
 int sdp_proc_dump_conn_main(char *buffer, 
 			    int   max_size, 
 			    off_t start_index, 
@@ -1556,8 +1588,9 @@ done:
 	"%08x %04x %04x %08x %04x %04x %04x %02x %02x " \
 	"%02x %02x %02x %04x %04x %04x %02x %02x %08x %04x %04x %04x\n"
 
-/* ========================================================================= */
-/*..sdp_proc_dump_conn_data - dump the connection table to /proc */
+/*
+ * sdp_proc_dump_conn_data - dump the connection table to /proc
+ */
 int sdp_proc_dump_conn_data(char *buffer,
 			    int   max_size,
 			    off_t start_index,
@@ -1661,8 +1694,9 @@ done:
 	"%04x %02x %02x %02x %02x %02x %02x %02x " \
 	"%04x %04x %04x %04x %04x %02x %02x %02x %02x %08x %08x %08x %08x\n"
 
-/* ========================================================================= */
-/*..sdp_proc_dump_conn_rdma - dump the connection table to /proc */
+/*
+ * sdp_proc_dump_conn_rdma - dump the connection table to /proc
+ */
 int sdp_proc_dump_conn_rdma(char *buffer, 
 			    int   max_size,
 			    off_t start_index,
@@ -1748,8 +1782,9 @@ done:
 #define SDP_PROC_CONN_SOPT_FORM \
 	"%02x.%02x.%02x.%02x:%04x %02x.%02x.%02x.%02x:%04x %08x %08x %04x\n"
 
-/* ========================================================================= */
-/*..sdp_proc_dump_conn_sopt - dump the options portion of each conn to /proc */
+/*
+ * sdp_proc_dump_conn_sopt - dump the options portion of each conn to /proc
+ */
 int sdp_proc_dump_conn_sopt(char *buffer,
 			    int   max_size,
 			    off_t start_index,
@@ -1819,8 +1854,9 @@ done:
 	return offset;
 } /* sdp_proc_dump_conn_sopt */
 
-/* ========================================================================= */
-/*..sdp_proc_dump_device - dump the primary device table to /proc */
+/*
+ * sdp_proc_dump_device - dump the primary device table to /proc
+ */
 int sdp_proc_dump_device(char *buffer,
 			 int   max_size,
 			 off_t start_index,
@@ -1867,14 +1903,13 @@ int sdp_proc_dump_device(char *buffer,
 	return offset;
 } /* sdp_proc_dump_device */
 
-/* --------------------------------------------------------------------- */
-/*                                                                       */
-/* initialization/cleanup functions                                      */
-/*                                                                       */
-/* --------------------------------------------------------------------- */
+/*
+ * initialization/cleanup functions
+ */
 
-/* ========================================================================= */
-/*.._sdp_device_table_init -- create hca list */
+/*
+ * sdp_device_init_one - add a device to the list
+ */
 static void sdp_device_init_one(struct ib_device *device)
 {
 	struct ib_fmr_pool_param fmr_param_s;
@@ -2009,10 +2044,11 @@ error:
 		(void)ib_dealloc_pd(hca->pd);
 
 	kfree(hca);
-} /* _sdp_device_table_init */
+} /* sdp_device_init_one */
 
-/* ========================================================================= */
-/*.._sdp_device_table_cleanup -- delete hca list */
+/*
+ * sdp_device_remove_one - remove a device from the hca list
+ */
 static void sdp_device_remove_one(struct ib_device *device)
 {
 	struct sdev_hca_port *port;
@@ -2046,10 +2082,11 @@ static void sdp_device_remove_one(struct
 		(void)ib_dealloc_pd(hca->pd);
 
 	kfree(hca);
-} /* _sdp_device_table_cleanup */
+} /* sdp_device_remove_one */
 
-/* ========================================================================= */
-/*..sdp_conn_table_init -- create a sdp connection table */
+/*
+ * sdp_conn_table_init - create a sdp connection table
+ */
 int sdp_conn_table_init(int proto_family,
 			int conn_size,
 			int recv_post_max,
@@ -2188,8 +2225,9 @@ error_hca:
 	return result;
 } /* sdp_conn_table_init */
 
-/* ========================================================================= */
-/*..sdp_conn_table_clear -- destroy connection managment and tables */
+/*
+ * sdp_conn_table_clear - destroy connection managment and tables
+ */
 int sdp_conn_table_clear(void)
  {
 	sdp_dbg_init("Deleting connection tables.");




More information about the general mailing list