[ofa-general] [PATCH] opensm/osm_subnet.c: fixing compiler warnings

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Mar 12 05:02:32 PDT 2009


Hi Sasha,

There are couple of meaningless CL_ASSERT() lines in the
parsing functions that are checking the parsed value.
The compiler says that "comparison is always true due
to limited range of data type". So either the 'val' type
should be more general when parsing it, or the CL_ASSERT()
lines are not needed. The following patch removes them.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_subnet.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index 4ab440b..ec15f8a 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -218,7 +218,6 @@ static void opts_parse_net16(IN osm_subn_t *p_subn, IN char *p_key,
 	uint16_t *p_val1 = p_v1, *p_val2 = p_v2;
 	uint16_t val = strtoul(p_val_str, NULL, 0);

-	CL_ASSERT(val < 0x10000);
 	if (cl_hton16(val) != *p_val1) {
 		log_config_value(p_key, "0x%04x", val);
 		if (pfn)
@@ -234,7 +233,6 @@ static void opts_parse_uint8(IN osm_subn_t *p_subn, IN char *p_key,
 	uint8_t *p_val1 = p_v1, *p_val2 = p_v2;
 	uint8_t val = strtoul(p_val_str, NULL, 0);

-	CL_ASSERT(val < 0x100);
 	if (val != *p_val1) {
 		log_config_value(p_key, "%u", val);
 		if (pfn)
-- 
1.5.1.4




More information about the general mailing list