[ofa-general] [PATCH 5/5] Various bug fixes to the tools I have found

Ira Weiny weiny2 at llnl.gov
Wed Apr 22 18:54:55 PDT 2009


>From 808598c4cc2ed2b4b3271d623c8d564448391e8d Mon Sep 17 00:00:00 2001
From: Ira Weiny <weiny2 at llnl.gov>
Date: Wed, 22 Apr 2009 18:44:17 -0700
Subject: [PATCH] Various bug fixes to the tools I have found

Signed-off-by: Ira Weiny <weiny2 at llnl.gov>
---
 infiniband-diags/scripts/iblinkinfo.pl.in |    2 +-
 infiniband-diags/src/iblinkinfo.c         |   10 ++++++----
 infiniband-diags/src/ibnetdiscover.c      |    2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/infiniband-diags/scripts/iblinkinfo.pl.in b/infiniband-diags/scripts/iblinkinfo.pl.in
index c81570d..0ce33ab 100755
--- a/infiniband-diags/scripts/iblinkinfo.pl.in
+++ b/infiniband-diags/scripts/iblinkinfo.pl.in
@@ -35,6 +35,6 @@
 #
 
 
-# this is not just a wrapper for the C based utility
+# this is now just a wrapper for the C based utility
 $str = join " ", at ARGV;
 exec "@IBSCRIPTPATH@/iblinkinfo $str";
diff --git a/infiniband-diags/src/iblinkinfo.c b/infiniband-diags/src/iblinkinfo.c
index 16728cb..82c2ce8 100644
--- a/infiniband-diags/src/iblinkinfo.c
+++ b/infiniband-diags/src/iblinkinfo.c
@@ -121,15 +121,17 @@ print_port(ibnd_node_t *node, ibnd_port_t *port)
 	char width_msg[256];
 	char speed_msg[256];
 	char ext_port_str[256];
-	int iwidth = mad_get_field(port->info, 0, IB_PORT_LINK_WIDTH_ACTIVE_F);
-	int ispeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F);
-	int istate = mad_get_field(port->info, 0, IB_PORT_STATE_F);
-	int iphystate = mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F);
+	int iwidth, ispeed, istate, iphystate;
 	int n = 0;
 
 	if (!port)
 		return;
 
+	iwidth = mad_get_field(port->info, 0, IB_PORT_LINK_WIDTH_ACTIVE_F);
+	ispeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F);
+	istate = mad_get_field(port->info, 0, IB_PORT_STATE_F);
+	iphystate = mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F);
+
 	remote_guid_str[0] = '\0';
 	remote_str[0] = '\0';
 	link_str[0] = '\0';
diff --git a/infiniband-diags/src/ibnetdiscover.c b/infiniband-diags/src/ibnetdiscover.c
index 4cd0b37..69fc5fb 100644
--- a/infiniband-diags/src/ibnetdiscover.c
+++ b/infiniband-diags/src/ibnetdiscover.c
@@ -690,7 +690,7 @@ int main(int argc, char **argv)
 	node_name_map = open_node_name_map(node_name_map_file);
 
 	if ((fabric = ibnd_discover_fabric(ibmad_port, ibd_timeout, NULL, -1)) == NULL)
-		IBERROR(stderr, "discover failed\n");
+		IBERROR("discover failed\n");
 
 	if (ports_report)
 		ibnd_iter_nodes(fabric,
-- 
1.5.4.5




More information about the general mailing list