Pārlūkot izejas kodu

[build] Remove unnecessary constraint on DBG_ENABLE()/DBG_DISABLE()

DBG_ENABLE() and DBG_DISABLE() are currently constrained to enabling
and disabling only debug levels that are compiled in for the current
object.  For example, a DBG_ENABLE(DBGLVL_EXTRA) in foo.c will not be
able to affect output from other objects at DBGLVL_EXTRA unless foo.c
is itself compiled with DBGLVL_EXTRA enabled.

Partially fix by removing this unnecessary constraint.  (Note that it
is still necessary for at least one debug level to be compiled in for
the object invoking DBG_ENABLE()/DBG_DISABLE().)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 gadus atpakaļ
vecāks
revīzija
79dd00bb3a
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2
    2
      src/include/compiler.h

+ 2
- 2
src/include/compiler.h Parādīt failu

@@ -286,10 +286,10 @@ extern void dbg_more ( void );
286 286
 int __debug_disable;
287 287
 #define DBGLVL ( DBGLVL_MAX & ~__debug_disable )
288 288
 #define DBG_DISABLE( level ) do {				\
289
-	__debug_disable |= ( (level) & DBGLVL_MAX );		\
289
+	__debug_disable |= (level);				\
290 290
 	} while ( 0 )
291 291
 #define DBG_ENABLE( level ) do {				\
292
-	__debug_disable &= ~( (level) & DBGLVL_MAX );		\
292
+	__debug_disable &= ~(level);				\
293 293
 	} while ( 0 )
294 294
 #else
295 295
 #define DBGLVL 0

Notiek ielāde…
Atcelt
Saglabāt