[openib-general] [PATCH] prepend sdp_ to global names

Michael S. Tsirkin mst at mellanox.co.il
Mon Feb 21 05:32:00 PST 2005


Some extern (non-static) variables did not start with sdp_ or anything
like that. Here's a fix.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: sdp_inet.c
===================================================================
--- sdp_inet.c	(revision 1846)
+++ sdp_inet.c	(working copy)
@@ -52,7 +52,7 @@ static int _send_post_max   = SDP_CQ_SEN
 static int _send_buff_max   = SDP_BUFF_SEND_MAX;
 static int _send_usig_max   = SDP_SEND_UNSIG_MAX;
 
-int debug_level = __SDP_DEBUG_LEVEL;
+int sdp_debug_level = __SDP_DEBUG_LEVEL;
 
 MODULE_AUTHOR("Libor Michalek");
 MODULE_DESCRIPTION("InfiniBand SDP module");
@@ -67,7 +67,7 @@ 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(debug_level, int, 0);
+module_param( sdp_debug_level, int, 0);
 
 /*
  * socket structure relevant fields:
Index: sdp_proto.h
===================================================================
--- sdp_proto.h	(revision 1846)
+++ sdp_proto.h	(working copy)
@@ -476,7 +476,7 @@ typedef int (*sdp_event_cb_func)(struct 
 /*
  * trace macros
  */
-extern int debug_level;
+extern int sdp_debug_level;
 #define __SDP_DEBUG_LEVEL 4
 
 #if defined(CONFIG_INFINIBAND_SDP_DEBUG)
@@ -497,7 +497,7 @@ extern int debug_level;
 
 #define __sdp_dbg_out(level, type, format, arg...) \
         do { \
-                if (!(level > debug_level)) { \
+                if (!(level > sdp_debug_level)) { \
                         printk("<%d>%s: " format "\n", \
                                level, type, ## arg);  \
                 } \
Index: sdp_msgs.h
===================================================================
--- sdp_msgs.h	(revision 1846)
+++ sdp_msgs.h	(working copy)
@@ -416,14 +416,14 @@ static __inline__ void __sdp_msg_swap_sc
 /*
  * Connection messages
  */
-struct msg_hello {
+struct sdp_msg_hello {
 	struct msg_hdr_bsdh bsdh;  /* base sockets direct header */
 	struct msg_hdr_hh   hh;    /* hello message header */
-} __attribute__ ((packed)); /* struct msg_hello */
+} __attribute__ ((packed)); /* struct sdp_msg_hello */
 
-struct msg_hello_ack {
+struct sdp_msg_hello_ack {
 	struct msg_hdr_bsdh bsdh;  /* base sockets direct header */
 	struct msg_hdr_hah  hah;   /* hello ack message header */
-} __attribute__ ((packed)); /* struct msg_hello_ack */
+} __attribute__ ((packed)); /* struct sdp_msg_hello_ack */
 
 #endif /* _SDP_MSGS_H */
Index: sdp_actv.c
===================================================================
--- sdp_actv.c	(revision 1846)
+++ sdp_actv.c	(working copy)
@@ -201,7 +201,7 @@ drop:
 /*
  * _sdp_cm_hello_ack_check - validate the hello ack header
  */
-static int _sdp_cm_hello_ack_check(struct msg_hello_ack *hello_ack)
+static int _sdp_cm_hello_ack_check(struct sdp_msg_hello_ack *hello_ack)
 {
 	/*
 	 * endian swap
@@ -211,11 +211,11 @@ static int _sdp_cm_hello_ack_check(struc
 	/*
 	 * validation and consistency checks
 	 */
-	if (hello_ack->bsdh.size != sizeof(struct msg_hello_ack)) {
+	if (hello_ack->bsdh.size != sizeof(struct sdp_msg_hello_ack)) {
 
 		sdp_dbg_warn(NULL, "hello ack, size mismatch. (2) <%d:%Zu>",
 			     hello_ack->bsdh.size,
-			     sizeof(struct msg_hello_ack));
+			     sizeof(struct sdp_msg_hello_ack));
 		return -EINVAL;
 	}
 
@@ -263,7 +263,7 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 		       struct ib_cm_event *event,
 		       struct sdp_opt *conn)
 {
-	struct msg_hello_ack *hello_ack;
+	struct sdp_msg_hello_ack *hello_ack;
 	int result;
 	int error;
 
@@ -277,7 +277,7 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 			     conn->cm_id->local_id, cm_id->local_id);
 	}
 
-	hello_ack = (struct msg_hello_ack *)event->private_data;
+	hello_ack = (struct sdp_msg_hello_ack *)event->private_data;
 
 	sdp_dbg_ctrl(conn, "CM REP. comm <%08x>", cm_id->local_id);
 	/*
@@ -381,7 +381,7 @@ static void _sdp_cm_path_complete(u64 id
 				  void *arg)
 {
 	struct ib_cm_req_param param;
-	struct msg_hello *hello_msg;
+	struct sdp_msg_hello *hello_msg;
 	struct sdp_opt *conn = (struct sdp_opt *) arg;
 	struct sdpc_buff *buff;
 	int result = 0;
@@ -450,10 +450,10 @@ static void _sdp_cm_path_complete(u64 id
 		goto failed;
 	}
 
-	hello_msg = (struct msg_hello *)buff->data;
-	buff->tail = buff->data + sizeof(struct msg_hello);
+	hello_msg = (struct sdp_msg_hello *)buff->data;
+	buff->tail = buff->data + sizeof(struct sdp_msg_hello);
 
-	memset(hello_msg, 0, sizeof(struct msg_hello));
+	memset(hello_msg, 0, sizeof(struct sdp_msg_hello));
 
 	conn->l_advt_bf = conn->recv_cq_size;
 	conn->l_max_adv = SDP_MSG_MAX_ADVS;
@@ -461,7 +461,7 @@ static void _sdp_cm_path_complete(u64 id
 	hello_msg->bsdh.recv_bufs = conn->l_advt_bf;
 	hello_msg->bsdh.flags     = SDP_MSG_FLAG_NON_FLAG;
 	hello_msg->bsdh.mid       = SDP_MID_HELLO;
-	hello_msg->bsdh.size      = sizeof(struct msg_hello);
+	hello_msg->bsdh.size      = sizeof(struct sdp_msg_hello);
 	hello_msg->bsdh.seq_num   = conn->send_seq;
 	hello_msg->bsdh.seq_ack   = conn->advt_seq;
 
@@ -587,10 +587,10 @@ 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) {
+	if (sizeof(struct sdp_msg_hello) > conn->recv_size) {
 
 		sdp_dbg_warn(conn, "buffer size <%d> too small. <%Zu>",
-			     conn->recv_size, sizeof(struct msg_hello));
+			     conn->recv_size, sizeof(struct sdp_msg_hello));
 		result = -ENOBUFS;
 		goto error;
 	}
Index: sdp_pass.c
===================================================================
--- sdp_pass.c	(revision 1846)
+++ sdp_pass.c	(working copy)
@@ -40,7 +40,7 @@
 static int _sdp_cm_accept(struct sdp_opt *conn)
 {
 	struct ib_cm_rep_param param;
-	struct msg_hello_ack *hello_ack;
+	struct sdp_msg_hello_ack *hello_ack;
 	struct sdpc_buff *buff;
 	struct ib_qp_attr *qp_attr;
 	int qp_mask = 0;
@@ -51,10 +51,10 @@ static int _sdp_cm_accept(struct sdp_opt
 	/*
 	 * build listen response headers
 	 */
-	if (sizeof(struct msg_hello_ack) > conn->recv_size) {
+	if (sizeof(struct sdp_msg_hello_ack) > conn->recv_size) {
 
 		sdp_dbg_warn(conn, "buffer size <%d> too small. <%Zu>",
-			     conn->recv_size, sizeof(struct msg_hello_ack));
+			     conn->recv_size, sizeof(struct sdp_msg_hello_ack));
 		result = -ENOBUFS;
 		goto error;
 	}
@@ -70,12 +70,12 @@ static int _sdp_cm_accept(struct sdp_opt
 		goto error;
 	}
 
-	hello_ack = (struct msg_hello_ack *)buff->data;
-	buff->tail = buff->data + sizeof(struct msg_hello_ack);
+	hello_ack = (struct sdp_msg_hello_ack *)buff->data;
+	buff->tail = buff->data + sizeof(struct sdp_msg_hello_ack);
 	/*
 	 * create the message
 	 */
-	memset(hello_ack, 0, sizeof(struct msg_hello_ack));
+	memset(hello_ack, 0, sizeof(struct sdp_msg_hello_ack));
 
 	conn->l_advt_bf = conn->recv_cq_size;
 	conn->l_max_adv = SDP_MSG_MAX_ADVS;
@@ -83,7 +83,7 @@ static int _sdp_cm_accept(struct sdp_opt
 	hello_ack->bsdh.recv_bufs = conn->l_advt_bf;
 	hello_ack->bsdh.flags     = SDP_MSG_FLAG_NON_FLAG;
 	hello_ack->bsdh.mid       = SDP_MID_HELLO_ACK;
-	hello_ack->bsdh.size      = sizeof(struct msg_hello_ack);
+	hello_ack->bsdh.size      = sizeof(struct sdp_msg_hello_ack);
 	hello_ack->bsdh.seq_num   = conn->send_seq;
 	hello_ack->bsdh.seq_ack   = conn->advt_seq;
 
@@ -313,7 +313,7 @@ lookup_err:
 /*
  * _sdp_cm_hello_check - validate the hello header
  */
-static int _sdp_cm_hello_check(struct msg_hello *msg_hello)
+static int _sdp_cm_hello_check(struct sdp_msg_hello *msg_hello)
 {
 	/*
 	 * endian swap
@@ -323,10 +323,10 @@ static int _sdp_cm_hello_check(struct ms
 	/*
 	 * validation and consistency checks
 	 */
-	if (msg_hello->bsdh.size != sizeof(struct msg_hello)) {
+	if (msg_hello->bsdh.size != sizeof(struct sdp_msg_hello)) {
 
 		sdp_dbg_warn(NULL, "hello msg size mismatch. (2) <%d:%Zu>",
-			     msg_hello->bsdh.size, sizeof(struct msg_hello));
+			     msg_hello->bsdh.size, sizeof(struct sdp_msg_hello));
 		return -EINVAL;
 	}
 
@@ -388,7 +388,7 @@ static int _sdp_cm_hello_check(struct ms
  */
 int sdp_cm_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
 {
-	struct msg_hello *msg_hello = (struct msg_hello *)event->private_data;
+	struct sdp_msg_hello *msg_hello = (struct sdp_msg_hello *)event->private_data;
 	struct sdp_opt *conn;
 	int result;
 

-- 
MST - Michael S. Tsirkin



More information about the general mailing list