[openib-general] [PATCH][SDP][7/22] Remove use of leading underscores in static names in sdp_inet.c

Tom Duffy Tom.Duffy at Sun.COM
Mon Feb 28 14:01:11 PST 2005


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

Index: drivers/infiniband/ulp/sdp/sdp_inet.c
===================================================================
--- drivers/infiniband/ulp/sdp/sdp_inet.c	(revision 1929)
+++ drivers/infiniband/ulp/sdp/sdp_inet.c	(working copy)
@@ -39,18 +39,18 @@
 /*
  * list of connections waiting for an incomming connection
  */
-static int _proto_family    = AF_INET_SDP;
-static int _buff_min        = SDP_BUFF_POOL_COUNT_MIN;
-static int _buff_max        = SDP_BUFF_POOL_COUNT_MAX;
-static int _alloc_inc       = SDP_BUFF_POOL_COUNT_INC;
-static int _free_mark       = SDP_BUFF_POOL_FREE_MARK;
-static int _conn_size       = SDP_DEV_SK_LIST_SIZE;
-
-static int _recv_post_max   = SDP_CQ_RECV_SIZE;
-static int _recv_buff_max   = SDP_BUFF_RECV_MAX;
-static int _send_post_max   = SDP_CQ_SEND_SIZE;
-static int _send_buff_max   = SDP_BUFF_SEND_MAX;
-static int _send_usig_max   = SDP_SEND_UNSIG_MAX;
+static int proto_family    = AF_INET_SDP;
+static int buff_min        = SDP_BUFF_POOL_COUNT_MIN;
+static int buff_max        = SDP_BUFF_POOL_COUNT_MAX;
+static int alloc_inc       = SDP_BUFF_POOL_COUNT_INC;
+static int free_mark       = SDP_BUFF_POOL_FREE_MARK;
+static int conn_size       = SDP_DEV_SK_LIST_SIZE;
+
+static int recv_post_max   = SDP_CQ_RECV_SIZE;
+static int recv_buff_max   = SDP_BUFF_RECV_MAX;
+static int send_post_max   = SDP_CQ_SEND_SIZE;
+static int send_buff_max   = SDP_BUFF_SEND_MAX;
+static int send_usig_max   = SDP_SEND_UNSIG_MAX;
 
 int sdp_debug_level = __SDP_DEBUG_LEVEL;
 
@@ -58,16 +58,16 @@ MODULE_AUTHOR("Libor Michalek");
 MODULE_DESCRIPTION("InfiniBand SDP module");
 MODULE_LICENSE("Dual BSD/GPL");
 
-module_param(_proto_family, int, 0);
-module_param(_buff_min, int, 0);
-module_param(_buff_max, int, 0);
-module_param(_conn_size, int, 0);
-module_param(_recv_post_max, int, 0);
-module_param(_recv_buff_max, int, 0);
-module_param(_send_post_max, int, 0);
-module_param(_send_buff_max, int, 0);
-module_param(_send_usig_max, int, 0);
-module_param( sdp_debug_level, int, 0);
+module_param(proto_family, int, 0);
+module_param(buff_min, int, 0);
+module_param(buff_max, int, 0);
+module_param(conn_size, int, 0);
+module_param(recv_post_max, int, 0);
+module_param(recv_buff_max, int, 0);
+module_param(send_post_max, int, 0);
+module_param(send_buff_max, int, 0);
+module_param(send_usig_max, int, 0);
+module_param(sdp_debug_level, int, 0);
 
 /*
  * socket structure relevant fields:
@@ -106,9 +106,8 @@ void sdp_inet_wake_send(struct sock *sk)
 	if (!sk || !(conn = SDP_GET_CONN(sk)))
 		return;
 
-	if (sk->sk_socket &&
-	    test_bit(SOCK_NOSPACE, &sk->sk_socket->flags) &&
-	    __sdp_inet_writable(conn)) {
+	if (sk->sk_socket && test_bit(SOCK_NOSPACE, &sk->sk_socket->flags) &&
+	    sdp_inet_writable(conn)) {
 		read_lock(&sk->sk_callback_lock);
 		clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
 
@@ -186,9 +185,9 @@ void sdp_inet_wake_urg(struct sock *sk)
  */
 
 /*
- * _sdp_inet_abort - abort an existing connection
+ * sdp_inet_abort - abort an existing connection
  */
-static int _sdp_inet_abort(struct sdp_opt *conn)
+static int sdp_inet_abort(struct sdp_opt *conn)
 {
 	int result;
 
@@ -233,9 +232,9 @@ static int _sdp_inet_abort(struct sdp_op
 }
 
 /*
- * _sdp_inet_disconnect - disconnect a connection
+ * sdp_inet_disconnect - disconnect a connection
  */
-static int _sdp_inet_disconnect(struct sdp_opt *conn)
+static int sdp_inet_disconnect(struct sdp_opt *conn)
 {
 	int result = 0;
 
@@ -296,9 +295,9 @@ static int _sdp_inet_disconnect(struct s
  */
 
 /*
- * _sdp_inet_release - release/close a socket
+ * sdp_inet_release - release/close a socket
  */
-static int _sdp_inet_release(struct socket *sock)
+static int sdp_inet_release(struct socket *sock)
 {
 	struct sdp_opt *conn;
 	struct sock *sk;
@@ -357,7 +356,7 @@ static int _sdp_inet_release(struct sock
 		/*
 		 * abort.
 		 */
-		result = _sdp_inet_abort(conn);
+		result = sdp_inet_abort(conn);
 		if (result < 0)
 			sdp_dbg_warn(conn, "Error <%d> while aborting socket",
 				     result);
@@ -367,7 +366,7 @@ static int _sdp_inet_release(struct sock
 	/*
 	 * disconnect. (state dependant)
 	 */
-	result = _sdp_inet_disconnect(conn);
+	result = sdp_inet_disconnect(conn);
 	if (result < 0) {
 		sdp_dbg_warn(conn, "Error <%d> while disconnecting socket",
 			     result);
@@ -414,7 +413,7 @@ static int _sdp_inet_release(struct sock
 
 			sdp_iocb_q_cancel_all_write(conn, -ECANCELED);
 
-			result = _sdp_inet_disconnect(conn);
+			result = sdp_inet_disconnect(conn);
 			SDP_EXPECT(result >= 0);
 		}
 #endif
@@ -435,10 +434,9 @@ done:
 }
 
 /*
- * _sdp_inet_bind - bind a socket to an address/interface
+ * sdp_inet_bind - bind a socket to an address/interface
  */
-static int _sdp_inet_bind(struct socket *sock, struct sockaddr *uaddr,
-			  int size)
+static int sdp_inet_bind(struct socket *sock, struct sockaddr *uaddr, int size)
 {
 	struct sockaddr_in *addr = (struct sockaddr_in *)uaddr;
 	struct sock *sk;
@@ -456,7 +454,7 @@ static int _sdp_inet_bind(struct socket 
 	if (size < sizeof(struct sockaddr_in))
 		return -EINVAL;
 
-	if (_proto_family != addr->sin_family &&
+	if (proto_family != addr->sin_family &&
 	    AF_INET != addr->sin_family && AF_UNSPEC != addr->sin_family)
 		return -EAFNOSUPPORT;
 	/*
@@ -527,12 +525,10 @@ done:
 }
 
 /*
- * _sdp_inet_connect - connect a socket to a remote address
+ * sdp_inet_connect - connect a socket to a remote address
  */
-static int _sdp_inet_connect(struct socket *sock,
-				struct sockaddr *uaddr,
-				int size,
-				int flags)
+static int sdp_inet_connect(struct socket *sock, struct sockaddr *uaddr,
+			    int size, int flags)
 {
 	struct sockaddr_in *addr = (struct sockaddr_in *)uaddr;
 	struct sock *sk;
@@ -549,7 +545,7 @@ static int _sdp_inet_connect(struct sock
 	if (size < sizeof(struct sockaddr_in))
 		return -EINVAL;
 
-	if (_proto_family != addr->sin_family &&
+	if (proto_family != addr->sin_family &&
 	    AF_INET != addr->sin_family && AF_UNSPEC != addr->sin_family)
 		return -EAFNOSUPPORT;
 
@@ -694,9 +690,9 @@ done:
 }
 
 /*
- * _sdp_inet_listen - listen on a socket for incomming addresses
+ * sdp_inet_listen - listen on a socket for incomming addresses
  */
-static int _sdp_inet_listen(struct socket *sock, int backlog)
+static int sdp_inet_listen(struct socket *sock, int backlog)
 {
 	struct sock *sk;
 	struct sdp_opt *conn;
@@ -751,11 +747,10 @@ done:
 }
 
 /*
- * _sdp_inet_accept - accept a new socket from a listen socket
+ * sdp_inet_accept - accept a new socket from a listen socket
  */
-static int _sdp_inet_accept(struct socket *listen_sock,
-			       struct socket *accept_sock, 
-			       int flags)
+static int sdp_inet_accept(struct socket *listen_sock,
+			   struct socket *accept_sock, int flags)
 {
 	struct sock *listen_sk;
 	struct sock *accept_sk = NULL;
@@ -908,10 +903,10 @@ listen_done:
 }
 
 /*
- * _sdp_inet_getname - return a sockets address information
+ * sdp_inet_getname - return a sockets address information
  */
-static int _sdp_inet_getname(struct socket *sock, struct sockaddr *uaddr,
-			     int *size, int peer)
+static int sdp_inet_getname(struct socket *sock, struct sockaddr *uaddr,
+			    int *size, int peer)
 {
 	struct sockaddr_in *addr = (struct sockaddr_in *)uaddr;
 	struct sock *sk;
@@ -924,7 +919,7 @@ static int _sdp_inet_getname(struct sock
 		     conn->src_addr, conn->src_port, 
 		     conn->dst_addr, conn->dst_port);
 
-	addr->sin_family = _proto_family;
+	addr->sin_family = proto_family;
 	if (peer > 0)
 		if (htons(conn->dst_port) > 0 &&
 		    !(SDP_ST_MASK_CLOSED & conn->istate)) {
@@ -944,11 +939,10 @@ static int _sdp_inet_getname(struct sock
 }
 
 /*
- * _sdp_inet_poll - poll a socket for activity
+ * sdp_inet_poll - poll a socket for activity
  */
-static unsigned int _sdp_inet_poll(struct file *file,
-				   struct socket *sock,
-				   poll_table *wait)
+static unsigned int sdp_inet_poll(struct file *file, struct socket *sock,
+				  poll_table *wait)
 {
 	struct sock *sk;
 	struct sdp_opt *conn;
@@ -1013,7 +1007,7 @@ static unsigned int _sdp_inet_poll(struc
 			set_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
 			set_bit(SOCK_NOSPACE, &sock->flags);
 
-			if (__sdp_inet_writable(conn)) {
+			if (sdp_inet_writable(conn)) {
 				mask |= POLLOUT | POLLWRNORM;
 
 				clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
@@ -1027,17 +1021,17 @@ static unsigned int _sdp_inet_poll(struc
 
 	sdp_dbg_data(conn, "POLL: mask <%08x> flags <%08lx> <%d:%d:%d>", 
 		     mask, sock->flags, conn->send_buf, conn->send_qud,
-		     __sdp_inet_writable(conn));
+		     sdp_inet_writable(conn));
 	
 
 	return mask;
 }
 
 /*
- * _sdp_inet_ioctl - serivce an ioctl request on a socket
+ * sdp_inet_ioctl - serivce an ioctl request on a socket
  */
-static int _sdp_inet_ioctl(struct socket *sock, unsigned int cmd,
-			   unsigned long arg)
+static int sdp_inet_ioctl(struct socket *sock, unsigned int cmd,
+			  unsigned long arg)
 {
 	struct sock *sk;
 	struct sdp_opt *conn;
@@ -1157,10 +1151,10 @@ static int _sdp_inet_ioctl(struct socket
 }
 
 /*
- * _sdp_inet_setopt - set a socket option
+ * sdp_inet_setopt - set a socket option
  */
-static int _sdp_inet_setopt(struct socket *sock, int level, int optname, 
-			    char __user *optval, int optlen)
+static int sdp_inet_setopt(struct socket *sock, int level, int optname, 
+			   char __user *optval, int optlen)
 {
 	struct sock *sk;
 	struct sdp_opt *conn;
@@ -1224,10 +1218,10 @@ static int _sdp_inet_setopt(struct socke
 }
 
 /*
- * _sdp_inet_getopt - get a socket option
+ * sdp_inet_getopt - get a socket option
  */
-static int _sdp_inet_getopt(struct socket *sock, int level, int optname,
-			    char __user *optval, int __user *optlen)
+static int sdp_inet_getopt(struct socket *sock, int level, int optname,
+			   char __user *optval, int __user *optlen)
 {
 	struct sock *sk;
 	struct sdp_opt *conn;
@@ -1286,9 +1280,9 @@ static int _sdp_inet_getopt(struct socke
 }
 
 /*
- * _sdp_inet_shutdown - shutdown a socket
+ * sdp_inet_shutdown - shutdown a socket
  */
-static int _sdp_inet_shutdown(struct socket *sock, int flag)
+static int sdp_inet_shutdown(struct socket *sock, int flag)
 {
 	int result = 0;
 	struct sdp_opt *conn;
@@ -1332,14 +1326,14 @@ static int _sdp_inet_shutdown(struct soc
 		break;
 	case SDP_SOCK_ST_ACCEPTED:
 	case SDP_SOCK_ST_CONNECT:
-		result = _sdp_inet_abort(conn);
+		result = sdp_inet_abort(conn);
 		if (result < 0)
 			sdp_dbg_warn(conn, "Error <%d> aborting connection",
 				     result);
 		break;
 	case SDP_SOCK_ST_ESTABLISHED:
 	case SDP_SOCK_ST_CLOSE:
-		result = _sdp_inet_disconnect(conn);
+		result = sdp_inet_disconnect(conn);
 		if (result < 0)
 			sdp_dbg_warn(conn, "Error <%d> disconnecting conn",
 				     result);
@@ -1380,30 +1374,30 @@ static int _sdp_inet_shutdown(struct soc
  * Primary socket initialization
  */
 struct proto_ops _lnx_stream_ops = {
-	.family     =  AF_INET_SDP,
-	.release    = _sdp_inet_release,
-	.bind       = _sdp_inet_bind,
-	.connect    = _sdp_inet_connect,
-	.listen     = _sdp_inet_listen,
-	.accept     = _sdp_inet_accept,
-	.sendmsg    =  sdp_inet_send,
-	.recvmsg    =  sdp_inet_recv,
-	.getname    = _sdp_inet_getname,
-	.poll       = _sdp_inet_poll,
-	.setsockopt = _sdp_inet_setopt,
-	.getsockopt = _sdp_inet_getopt,
-	.shutdown   = _sdp_inet_shutdown,
-	.ioctl      = _sdp_inet_ioctl,
-	.sendpage   =  sock_no_sendpage,
-	.socketpair =  sock_no_socketpair,
-	.mmap       =  sock_no_mmap,
-	.owner      =  THIS_MODULE,
+	.family     = AF_INET_SDP,
+	.release    = sdp_inet_release,
+	.bind       = sdp_inet_bind,
+	.connect    = sdp_inet_connect,
+	.listen     = sdp_inet_listen,
+	.accept     = sdp_inet_accept,
+	.sendmsg    = sdp_inet_send,
+	.recvmsg    = sdp_inet_recv,
+	.getname    = sdp_inet_getname,
+	.poll       = sdp_inet_poll,
+	.setsockopt = sdp_inet_setopt,
+	.getsockopt = sdp_inet_getopt,
+	.shutdown   = sdp_inet_shutdown,
+	.ioctl      = sdp_inet_ioctl,
+	.sendpage   = sock_no_sendpage,
+	.socketpair = sock_no_socketpair,
+	.mmap       = sock_no_mmap,
+	.owner      = THIS_MODULE,
 };
 
 /*
- * _sdp_inet_create - create a socket
+ * sdp_inet_create - create a socket
  */
-static int _sdp_inet_create(struct socket *sock, int protocol)
+static int sdp_inet_create(struct socket *sock, int protocol)
 {
 	struct sdp_opt *conn;
 
@@ -1446,9 +1440,9 @@ static int _sdp_inet_create(struct socke
 /*
  * INET module initialization functions
  */
-static struct net_proto_family _sdp_proto = {
+static struct net_proto_family sdp_proto = {
 	.family =  AF_INET_SDP,
-	.create = _sdp_inet_create,
+	.create = sdp_inet_create,
 	.owner  =  THIS_MODULE,
 };
 
@@ -1494,10 +1488,10 @@ static int __init sdp_init(void)
 	/*
 	 * buffer memory
 	 */
-	result = sdp_buff_pool_init(_buff_min, 
-				    _buff_max, 
-				    _alloc_inc, 
-				    _free_mark);
+	result = sdp_buff_pool_init(buff_min, 
+				    buff_max, 
+				    alloc_inc, 
+				    free_mark);
 	if (result < 0) {
 		sdp_warn("INIT: Error <%d> initializing buffer pool.", result);
 		goto error_buff;
@@ -1505,13 +1499,13 @@ static int __init sdp_init(void)
 	/*
 	 * connection table
 	 */
-	result = sdp_conn_table_init(_proto_family,
-				     _conn_size, 
-				     _recv_post_max,
-				     _recv_buff_max,
-				     _send_post_max,
-				     _send_buff_max,
-				     _send_usig_max);
+	result = sdp_conn_table_init(proto_family,
+				     conn_size, 
+				     recv_post_max,
+				     recv_buff_max,
+				     send_post_max,
+				     send_buff_max,
+				     send_usig_max);
 	if (result < 0) {
 		sdp_warn("INIT: Error <%d> initializing connection table.",
 			 result);
@@ -1520,12 +1514,12 @@ static int __init sdp_init(void)
 	/*
 	 * register
 	 */
-	_sdp_proto.family = _proto_family;
+	sdp_proto.family = proto_family;
 
-	result = sock_register(&_sdp_proto);
+	result = sock_register(&sdp_proto);
 	if (result < 0) {
 		sdp_warn("INIT: Error <%d> registering protocol family <%d>",
-			 result, _sdp_proto.family);
+			 result, sdp_proto.family);
 		goto error_sock;
 	}
 
@@ -1553,7 +1547,7 @@ static void __exit sdp_exit(void)
 	/*
 	 * unregister
 	 */
-	sock_unregister(_sdp_proto.family);
+	sock_unregister(sdp_proto.family);
 	/*
 	 * connection table
 	 */




More information about the general mailing list