[openib-general] [PATCH 1/2] libibumad/libibmad/diags: fix printf style uses
Sasha Khapyorsky
sashak at voltaire.com
Thu Nov 16 06:58:16 PST 2006
This fixes various uses of printf() style functions.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
diags/src/ibnetdiscover.c | 7 ++++---
diags/src/ibtracert.c | 15 ++++++++-------
libibmad/src/rpc.c | 2 +-
libibumad/src/umad.c | 16 ++++++++--------
4 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/diags/src/ibnetdiscover.c b/diags/src/ibnetdiscover.c
index c6e35e4..612aee0 100644
--- a/diags/src/ibnetdiscover.c
+++ b/diags/src/ibnetdiscover.c
@@ -44,6 +44,7 @@ #include <time.h>
#include <string.h>
#include <getopt.h>
#include <ctype.h>
+#include <inttypes.h>
#define __BUILD_VERSION_TAG__ 1.2
#include <common.h>
@@ -175,8 +176,8 @@ get_node(Node *node, Port *port, ib_port
mad_decode_field(si, IB_SW_ENHANCED_PORT0_F, &node->smaenhsp0);
}
- DEBUG("portid %s: got switch node %Lx '%s'",
- portid2str(portid), node->nodeguid, nd);
+ DEBUG("portid %s: got switch node %" PRIx64 " '%s'",
+ portid2str(portid), node->nodeguid, node->nodedesc);
return 1;
}
@@ -242,7 +243,7 @@ insert_node(Node *new)
for (node = nodestbl[hash]; node; node = node->htnext)
if (node->nodeguid == new->nodeguid) {
- DEBUG("node %Lx already exists", new->nodeguid);
+ DEBUG("node %" PRIx64 " already exists", new->nodeguid);
return node;
}
diff --git a/diags/src/ibtracert.c b/diags/src/ibtracert.c
index 64dbe00..56c312d 100644
--- a/diags/src/ibtracert.c
+++ b/diags/src/ibtracert.c
@@ -43,6 +43,7 @@ #include <stdarg.h>
#include <ctype.h>
#include <getopt.h>
#include <netinet/in.h>
+#include <inttypes.h>
#define __BUILD_VERSION_TAG__ 1.2
#include <common.h>
@@ -166,7 +167,7 @@ get_node(Node *node, Port *port, ib_port
mad_decode_field(pi, IB_PORT_LMC_F, &port->lmc);
mad_decode_field(pi, IB_PORT_STATE_F, &port->state);
- DEBUG("portid %s: got node %Lx '%s'", portid2str(portid), node->nodeguid, nd);
+ DEBUG("portid %s: got node %" PRIx64 " '%s'", portid2str(portid), node->nodeguid, node->nodedesc);
return 0;
}
@@ -332,7 +333,7 @@ find_route(ib_portid_t *from, ib_portid_
DEBUG("ca or router node");
if (!sameport(port, &fromport)) {
- IBWARN("can't continue: reached CA or router port %Lx, lid %d",
+ IBWARN("can't continue: reached CA or router port %" PRIx64 ", lid %d",
port->portguid, port->lid);
return -1;
}
@@ -378,7 +379,7 @@ badoutport:
return -1;
badtbl:
IBWARN("Bad forwarding table entry found at: node \"%s\" lid entry %d is %d (top %d)",
- node->nodedesc, to, outport, sw.linearFDBtop);
+ node->nodedesc, to->lid, outport, sw.linearFDBtop);
return -1;
badpath:
IBWARN("Direct path too long!");
@@ -402,7 +403,7 @@ insert_node(Node *new)
for (node = nodestbl[hash]; node; node = node->htnext)
if (node->nodeguid == new->nodeguid) {
- DEBUG("node %Lx already exists", new->nodeguid);
+ DEBUG("node %" PRIx64 " already exists", new->nodeguid);
return -1;
}
@@ -501,7 +502,7 @@ switch_mclookup(Node *node, ib_portid_t
*map = 1;
else
continue;
- VERBOSE("Switch guid 0x%Lx: mlid 0x%x is forwarded to port %d",
+ VERBOSE("Switch guid 0x%" PRIx64 ": mlid 0x%x is forwarded to port %d",
node->nodeguid, mlid + 0xc000, i + set * 16);
}
}
@@ -565,7 +566,7 @@ find_mcpath(ib_portid_t *from, int mlid)
leafport = path->drpath.p[path->drpath.cnt];
map[port->portnum] = 1;
node->upport = 0; /* starting here */
- DEBUG("Starting from CA 0x%Lx lid %d port %d (leafport %d)",
+ DEBUG("Starting from CA 0x%" PRIx64 " lid %d port %d (leafport %d)",
node->nodeguid, port->lid, port->portnum, leafport);
} else { /* switch */
@@ -574,7 +575,7 @@ find_mcpath(ib_portid_t *from, int mlid)
node->upport = leafport;
if (switch_mclookup(node, path, mlid, map) < 0) {
- IBWARN("skipping bad Switch 0x%Lx lid %d",
+ IBWARN("skipping bad Switch 0x%" PRIx64 " lid %" PRIx64 "",
node->nodeguid, port->portguid);
continue;
}
diff --git a/libibmad/src/rpc.c b/libibmad/src/rpc.c
index 142f8d8..3164b12 100644
--- a/libibmad/src/rpc.c
+++ b/libibmad/src/rpc.c
@@ -123,7 +123,7 @@ _do_madrpc(int port_id, void *sndbuf, vo
timeout = def_madrpc_timeout;
if (ibdebug > 1) {
- IBWARN(">>> sending: len %d pktsz %d", len, umad_size() + len);
+ IBWARN(">>> sending: len %d pktsz %zu", len, umad_size() + len);
xdump(stderr, "send buf\n", sndbuf, umad_size() + len);
}
diff --git a/libibumad/src/umad.c b/libibumad/src/umad.c
index 71b6833..ee9f65f 100644
--- a/libibumad/src/umad.c
+++ b/libibumad/src/umad.c
@@ -473,7 +473,7 @@ umad_init(void)
{
uint abi_version;
- TRACE("");
+ TRACE("umad_init");
if (sys_read_uint(IB_UMAD_ABI_DIR, IB_UMAD_ABI_FILE, &abi_version) < 0) {
IBWARN("can't read ABI version from %s/%s (%m): is ib_umad module loaded?",
IB_UMAD_ABI_DIR, IB_UMAD_ABI_FILE);
@@ -490,7 +490,7 @@ umad_init(void)
int
umad_done(void)
{
- TRACE("");
+ TRACE("umad_done");
/* FIXME - verify that all ports are closed */
return 0;
}
@@ -756,7 +756,7 @@ umad_send(int portid, int agentid, void
if (n == length + sizeof *mad)
return 0;
- DEBUG("write returned %d != sizeof umad %d + length %d (%m)",
+ DEBUG("write returned %d != sizeof umad %zu + length %d (%m)",
n, sizeof *mad, length);
if (!errno)
errno = EIO;
@@ -824,7 +824,7 @@ umad_recv(int portid, void *umad, int *l
return n;
}
- DEBUG("read returned %d > sizeof umad %d + length %d (%m)",
+ DEBUG("read returned %zu > sizeof umad %zu + length %d (%m)",
mad->length - sizeof *mad, sizeof *mad, *length);
*length = mad->length - sizeof *mad;
@@ -888,12 +888,12 @@ umad_register_oui(int portid, int mgmt_c
memset(req.method_mask, 0, sizeof req.method_mask);
if (!ioctl(port->dev_fd, IB_USER_MAD_REGISTER_AGENT, (void *)&req)) {
- DEBUG("portid %d registered to use agent %d qp %d class 0x%x oui 0x%x",
- portid, req.id, req.qpn, oui);
+ DEBUG("portid %d registered to use agent %d qp %d class 0x%x oui %p",
+ portid, req.id, req.qpn, req.mgmt_class, oui);
return req.id; /* return agentid */
}
- DEBUG("portid %d registering qp %d class 0x%x version %d oui 0x%x failed: %m",
+ DEBUG("portid %d registering qp %d class 0x%x version %d oui %p failed: %m",
portid, req.qpn, req.mgmt_class, req.mgmt_class_version, oui);
return -EPERM;
}
@@ -941,7 +941,7 @@ umad_unregister(int portid, int agentid)
{
Port *port;
- TRACE("portid %d unregistering agent %d", agentid);
+ TRACE("portid %d unregistering agent %d", portid, agentid);
if (!(port = port_get(portid)))
return -EINVAL;
--
1.4.3.2.g4bf7
More information about the general
mailing list