[ofa-general] [PATCH] opensm/osm_subnet: don't reassign zeroed config params

Sasha Khapyorsky sashak at voltaire.com
Tue Nov 18 02:43:27 PST 2008


If string config parameter is NULL and input is null_str don't reassign
it again (and don't print useless "Loading Option" message).

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/opensm/osm_subnet.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index dc35a04..d787fe8 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -623,7 +623,8 @@ opts_unpack_charp(IN char *p_req_key,
 		  IN char *p_key, IN char *p_val_str, IN char **p_val)
 {
 	if (!strcmp(p_req_key, p_key) && p_val_str) {
-		if ((*p_val == NULL) || strcmp(p_val_str, *p_val)) {
+		const char *current_str = *p_val ? *p_val : null_str ;
+		if (strcmp(p_val_str, current_str)) {
 			log_config_value(p_key, "%s", p_val_str);
 			/* special case the "(null)" string */
 			if (strcmp(null_str, p_val_str) == 0) {
-- 
1.6.0.3.517.g759a




More information about the general mailing list