Skip to contentSkip to conversation

infiniband-diags/libibnetdisc/ibnetdisc.c: Fix compile warns on 32 bit archs

PATCH In review Hal Rosenstock 2 participants 2 messages May 24, 2010 – May 25, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infiniband-diags/libibnetdisc/ibnetdisc.c: Fix compile warns on 32 bit archs

src/ibnetdisc.c: In function `query_port_info':
src/ibnetdisc.c:216: warning: long unsigned int format, different type arg (arg 5) src/ibnetdisc.c: In function `recv_node_info':
src/ibnetdisc.c:311: warning: long unsigned int format, different type arg (arg 5) src/ibnetdisc.c:335: warning: long unsigned int format, different type arg (arg 6)

---
 infiniband-diags/libibnetdisc/src/ibnetdisc.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
infiniband-diags/libibnetdisc/src/ibnetdisc.c +7 -5
index 98801de..157b866 100644
@@ -211,8 +211,8 @@ static int recv_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
 static int query_port_info(smp_engine_t * engine, ib_portid_t * portid,
 			   ibnd_node_t * node, int portnum)
 {
-	IBND_DEBUG("Query Port Info; %s (%lx):%d\n", portid2str(portid),
-		   node->guid, portnum);
+	IBND_DEBUG("Query Port Info; %s (0x%" PRIx64 "):%d\n",
+		   portid2str(portid), node->guid, portnum);
 	return issue_smp(engine, portid, IB_ATTR_PORT_INFO, portnum,
 			 recv_port_info, node);
 }
@@ -307,8 +307,9 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
 			return -1;
 		node_is_new = 1;
 	}
-	IBND_DEBUG("Found %s node GUID %lx (%s)\n", node_is_new ? "new" : "old",
-		   node->guid, portid2str(&smp->path));
+	IBND_DEBUG("Found %s node GUID 0x%" PRIx64 "(%s)\n",
+		   node_is_new ? "new" : "old", node->guid,
+		   portid2str(&smp->path));
 
 	port = node->ports[port_num];
 	if (!port) {
@@ -331,7 +332,8 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
 
 		if (!rem_node->ports[rem_port_num]) {
 			IBND_ERROR("Internal Error; "
-				   "Node(%p) %lx Port %d no port created!?!?!?\n\n",
+				   "Node(%p) 0x%" PRIx64
+				   "Port %d no port created!?!?!?\n\n",
 				   rem_node, rem_node->guid, rem_port_num);
 			return -1;
 		}
Signature · 6 lines
1.5.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 8 lines · Hal Rosenstock

src/ibnetdisc.c: In function `query_port_info':
src/ibnetdisc.c:216: warning: long unsigned int format, different type arg (arg 5) src/ibnetdisc.c: In function `recv_node_info':
src/ibnetdisc.c:311: warning: long unsigned int format, different type arg (arg 5) src/ibnetdisc.c:335: warning: long unsigned int format, different type arg (arg 6)

Applied with minor fixes (see below). Thanks.

Quoted 20 lines
---
 infiniband-diags/libibnetdisc/src/ibnetdisc.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
infiniband-diags/libibnetdisc/src/ibnetdisc.c +2 -2
index 98801de..157b866 100644
@@ -211,8 +211,8 @@ static int recv_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
 static int query_port_info(smp_engine_t * engine, ib_portid_t * portid,
 			   ibnd_node_t * node, int portnum)
 {
-	IBND_DEBUG("Query Port Info; %s (%lx):%d\n", portid2str(portid),
-		   node->guid, portnum);
+	IBND_DEBUG("Query Port Info; %s (0x%" PRIx64 "):%d\n",
+		   portid2str(portid), node->guid, portnum);
 	return issue_smp(engine, portid, IB_ATTR_PORT_INFO, portnum,
 			 recv_port_info, node);
 }

infiniband-diags/libibnetdisc/src/ibnetdisc.c static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp, · line 310

Quoted 6 lines
infiniband-diags/libibnetdisc/src/ibnetdisc.c +1 -2
@@ -307,8 +307,9 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
 			return -1;
 		node_is_new = 1;
 	}
-	IBND_DEBUG("Found %s node GUID %lx (%s)\n", node_is_new ? "new" : "old",
-		   node->guid, portid2str(&smp->path));
+	IBND_DEBUG("Found %s node GUID 0x%" PRIx64 "(%s)\n",

The space is missed after GUID value printing and before '(', so adding this back.

infiniband-diags/libibnetdisc/src/ibnetdisc.c static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp, · line 336

Quoted 12 lines
infiniband-diags/libibnetdisc/src/ibnetdisc.c +4 -1
+		   node_is_new ? "new" : "old", node->guid,
+		   portid2str(&smp->path));
 
 	port = node->ports[port_num];
 	if (!port) {
@@ -331,7 +332,8 @@ static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
 
 		if (!rem_node->ports[rem_port_num]) {
 			IBND_ERROR("Internal Error; "
-				   "Node(%p) %lx Port %d no port created!?!?!?\n\n",
+				   "Node(%p) 0x%" PRIx64
+				   "Port %d no port created!?!?!?\n\n",

The space is missed between GUID value and 'Port' word. Adding back.

Sasha

Quoted 6 lines
infiniband-diags/libibnetdisc/src/ibnetdisc.c +0 -0
 				   rem_node, rem_node->guid, rem_port_num);
 			return -1;
 		}
Signature · 1 line
1.5.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html