[MLX4] prevent constant comparison to please PREfast (winib 2461)
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 18 May 2008 14:27:22 +0000 (14:27 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 18 May 2008 14:27:22 +0000 (14:27 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1182 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mlx4/kernel/inc/mlx4_debug.h

index 7141f35..1baaee6 100644 (file)
@@ -63,7 +63,8 @@ end:
 #define MLX4_PRINT_TO_EVENT_LOG(_obj_,_level_,_flag_,_msg_)  \\r
        { \\r
                NTSTATUS event_id; \\r
-               switch (_level_) { \\r
+               int __lvl = _level_; \\r
+               switch (__lvl) { \\r
                        case TRACE_LEVEL_FATAL: case TRACE_LEVEL_ERROR: event_id = EVENT_MLX4_ANY_ERROR; break; \\r
                        case TRACE_LEVEL_WARNING: event_id = EVENT_MLX4_ANY_WARN; break; \\r
                        default: event_id = EVENT_MLX4_ANY_INFO; break; \\r
@@ -158,7 +159,7 @@ end:
 #define MLX4_PRINT(_level_,_flag_,_msg_)  \\r
        { \\r
                int __lvl = _level_; \\r
-               if (g_mlx4_dbg_level >= (_level_) && \\r
+               if (g_mlx4_dbg_level >= (__lvl) && \\r
                        (g_mlx4_dbg_flags & (_flag_))) { \\r
                                DbgPrint ("~%d:[MLX4_BUS] %s() :", KeGetCurrentProcessorNumber(), __FUNCTION__); \\r
                                if(__lvl == TRACE_LEVEL_ERROR) DbgPrint ("***ERROR***  "); \\r
@@ -192,3 +193,4 @@ end:
 \r
 \r
 \r
+\r