Skip to contentSkip to conversation

osmtest - fix signed unsigned comparisons

PATCH Applied Stan C. Smith 3 participants 3 messages Oct 12, 2009 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 osmtest - fix signed unsigned comparisons

Make for loop index match loop termination comparison type.

opensm/osmtest/main.c +2 -2
index 4bb9f82..588a477 100644
@@ -214,7 +214,7 @@ static void print_all_guids(IN osmtest_t * p_osmt)
 	ib_api_status_t status;
 	uint32_t num_ports = MAX_LOCAL_IBPORTS;
 	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS];
-	int i;
+	uint32_t i;
 
 	for (i = 0; i < num_ports; i++) {
 		attr_array[i].num_pkeys = 0;
@@ -247,7 +247,7 @@ ib_net64_t get_port_guid(IN osmtest_t * p_osmt, uint64_t port_guid)
 	ib_api_status_t status;
 	uint32_t num_ports = MAX_LOCAL_IBPORTS;
 	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS];
-	int i;
+	uint32_t i;
 
 	for (i = 0; i < num_ports; i++) {
 		attr_array[i].num_pkeys = 0;
opensm/osmtest/osmtest.c +1 -1
index c6ec955..a1457b8 100644
@@ -7237,7 +7237,7 @@ osmtest_bind(IN osmtest_t * p_osmt,
 	ib_api_status_t status;
 	uint32_t num_ports = MAX_LOCAL_IBPORTS;
 	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS];
-	int i;
+	uint32_t i;
 
 	OSM_LOG_ENTER(&p_osmt->log);

A message that is not in the archive (sent off-list or not yet received): F7FAC243E7364BC582B7FCDBE42FB384-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org

#3 lore raw

PATCH 1/1 osmtest: initialize attr_array[] on declaration

Initialize attr_array[] arrays on declaration.

---
 opensm/osmtest/main.c    |   14 ++------------
 opensm/osmtest/osmtest.c |    8 +-------
 2 files changed, 3 insertions(+), 19 deletions(-)
opensm/osmtest/main.c +2 -12
index 11bb0c8..4cead91 100644
@@ -213,14 +213,9 @@ static void print_all_guids(IN osmtest_t * p_osmt)
 {
 	ib_api_status_t status;
 	uint32_t num_ports = MAX_LOCAL_IBPORTS;
-	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS];
+	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS] = { {0} };
 	uint32_t i;
 
-	for (i = 0; i < num_ports; i++) {
-		attr_array[i].num_pkeys = 0;
-		attr_array[i].p_pkey_table = NULL;
-	}
-
 	/*
 	   Call the transport layer for a list of local port
 	   GUID values.
@@ -246,14 +241,9 @@ ib_net64_t get_port_guid(IN osmtest_t * p_osmt, uint64_t port_guid)
 {
 	ib_api_status_t status;
 	uint32_t num_ports = MAX_LOCAL_IBPORTS;
-	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS];
+	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS] = { {0} };
 	uint32_t i;
 
-	for (i = 0; i < num_ports; i++) {
-		attr_array[i].num_pkeys = 0;
-		attr_array[i].p_pkey_table = NULL;
-	}
-
 	/*
 	   Call the transport layer for a list of local port
 	   GUID values.
opensm/osmtest/osmtest.c +1 -7
index a1457b8..9dd1117 100644
@@ -7236,16 +7236,10 @@ osmtest_bind(IN osmtest_t * p_osmt,
 	uint32_t port_index;
 	ib_api_status_t status;
 	uint32_t num_ports = MAX_LOCAL_IBPORTS;
-	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS];
-	uint32_t i;
+	ib_port_attr_t attr_array[MAX_LOCAL_IBPORTS] = { {0} };
 
 	OSM_LOG_ENTER(&p_osmt->log);
 
-	for (i = 0; i < num_ports; i++) {
-		attr_array[i].num_pkeys = 0;
-		attr_array[i].p_pkey_table = NULL;
-	}
-
 	/*
 	 * Call the transport layer for a list of local port
 	 * GUID values.
Signature · 6 lines
1.6.5

--
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