* [PATCH] osmtest - fix signed unsigned comparisons
@ 2009-10-12 17:21 Stan C. Smith
2009-10-12 21:35 ` Sasha Khapyorsky
[not found] ` <F7FAC243E7364BC582B7FCDBE42FB384-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
0 siblings, 2 replies; 3+ messages in thread
From: Stan C. Smith @ 2009-10-12 17:21 UTC (permalink / raw)
To: 'Sasha Khapyorsky'; +Cc: ofw, 'linux-rdma'
Make for loop index match loop termination comparison type.
Signed-off-by: stan smith <stan.smith@intel.com>
diff --git a/opensm/osmtest/main.c b/opensm/osmtest/main.c
index 4bb9f82..588a477 100644
--- a/opensm/osmtest/main.c
+++ b/opensm/osmtest/main.c
@@ -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;
diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
index c6ec955..a1457b8 100644
--- a/opensm/osmtest/osmtest.c
+++ b/opensm/osmtest/osmtest.c
@@ -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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] osmtest - fix signed unsigned comparisons
2009-10-12 17:21 [PATCH] osmtest - fix signed unsigned comparisons Stan C. Smith
@ 2009-10-12 21:35 ` Sasha Khapyorsky
[not found] ` <F7FAC243E7364BC582B7FCDBE42FB384-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
1 sibling, 0 replies; 3+ messages in thread
From: Sasha Khapyorsky @ 2009-10-12 21:35 UTC (permalink / raw)
To: Stan C. Smith; +Cc: ofw, 'linux-rdma'
On 10:21 Mon 12 Oct , Stan C. Smith wrote:
>
> Make for loop index match loop termination comparison type.
>
> Signed-off-by: stan smith <stan.smith@intel.com>
Applied. Thanks.
Sasha
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] osmtest: initialize attr_array[] on declaration
[not found] ` <F7FAC243E7364BC582B7FCDBE42FB384-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2009-10-12 21:36 ` Sasha Khapyorsky
0 siblings, 0 replies; 3+ messages in thread
From: Sasha Khapyorsky @ 2009-10-12 21:36 UTC (permalink / raw)
To: linux-rdma; +Cc: Stan C. Smith
Initialize attr_array[] arrays on declaration.
Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
opensm/osmtest/main.c | 14 ++------------
opensm/osmtest/osmtest.c | 8 +-------
2 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/opensm/osmtest/main.c b/opensm/osmtest/main.c
index 11bb0c8..4cead91 100644
--- a/opensm/osmtest/main.c
+++ b/opensm/osmtest/main.c
@@ -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.
diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
index a1457b8..9dd1117 100644
--- a/opensm/osmtest/osmtest.c
+++ b/opensm/osmtest/osmtest.c
@@ -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.
--
1.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-12 21:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12 17:21 [PATCH] osmtest - fix signed unsigned comparisons Stan C. Smith
2009-10-12 21:35 ` Sasha Khapyorsky
[not found] ` <F7FAC243E7364BC582B7FCDBE42FB384-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-12 21:36 ` [PATCH] osmtest: initialize attr_array[] on declaration Sasha Khapyorsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.