[ofa-general] [PATCH] infiniband-diags/saquery.c: Fix CHECK_AND_SET_VAL macro

Hal Rosenstock hnrose at comcast.net
Sat Aug 15 06:46:24 PDT 2009


Changed check from > to != since using integer comparison
and some masks can use full range and hence be negative 

Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>
---
diff --git a/infiniband-diags/src/saquery.c b/infiniband-diags/src/saquery.c
index 330c6aa..e1e2cfc 100644
--- a/infiniband-diags/src/saquery.c
+++ b/infiniband-diags/src/saquery.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
  * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2009 HNR Consulting. All rights reserved.
  *
  * Produced at Lawrence Livermore National Laboratory.
  * Written by Ira Weiny <weiny2 at llnl.gov>.
@@ -922,7 +923,7 @@ static int parse_lid_and_ports(bind_handle_t h,
 
 #define cl_hton8(x) (x)
 #define CHECK_AND_SET_VAL(val, size, comp_with, target, name, mask) \
-	if ((int##size##_t) val > (int##size##_t) comp_with) { \
+	if ((int##size##_t) val != (int##size##_t) comp_with) { \
 		target = cl_hton##size((uint##size##_t) val); \
 		comp_mask |= IB_##name##_COMPMASK_##mask; \
 	}



More information about the general mailing list