diff options
author | Bob Moore <robert.moore@intel.com> | 2013-01-08 17:46:04 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-10 06:36:23 -0500 |
commit | 6e1888fdcaad176fd9ce1180d97a16f2e6ea707c (patch) | |
tree | f24988c916e6c75e13f84847fa37443d27ef43d5 /include/acpi | |
parent | f55994f20523532c02056f8f0d80495c375ee271 (diff) |
ACPICA: Cleanup ACPI_DEBUG_PRINT macros to fix potential build breakages.
Fix two issues with the ACPI_DEBUG_PRINT macros.
1) Add the ACPI_DO_WHILE0 macro to the main DEBUG_PRINT helper macro.
2) Rename ACPI_DEBUG macro to ACPI_DO_DEBUG_PRINT since ACPI_DEBUG
is already commonly used by the various hosts.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/acoutput.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 23db272e0bff..b48cb3459778 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -281,7 +281,16 @@ | |||
281 | * debug message outside of the print function itself. This improves overall | 281 | * debug message outside of the print function itself. This improves overall |
282 | * performance at a relatively small code cost. Implementation involves the | 282 | * performance at a relatively small code cost. Implementation involves the |
283 | * use of variadic macros supported by C99. | 283 | * use of variadic macros supported by C99. |
284 | * | ||
285 | * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from | ||
286 | * complaining about these constructs. On other compilers the do...while | ||
287 | * adds some extra code, so this feature is optional. | ||
284 | */ | 288 | */ |
289 | #ifdef ACPI_USE_DO_WHILE_0 | ||
290 | #define ACPI_DO_WHILE0(a) do a while(0) | ||
291 | #else | ||
292 | #define ACPI_DO_WHILE0(a) a | ||
293 | #endif | ||
285 | 294 | ||
286 | /* DEBUG_PRINT functions */ | 295 | /* DEBUG_PRINT functions */ |
287 | 296 | ||
@@ -290,17 +299,21 @@ | |||
290 | 299 | ||
291 | /* Helper macros for DEBUG_PRINT */ | 300 | /* Helper macros for DEBUG_PRINT */ |
292 | 301 | ||
293 | #define ACPI_DEBUG(function, level, line, filename, modulename, component, ...) \ | 302 | #define ACPI_DO_DEBUG_PRINT(function, level, line, filename, modulename, component, ...) \ |
294 | if (ACPI_IS_DEBUG_ENABLED (level, component)) \ | 303 | ACPI_DO_WHILE0 ({ \ |
295 | { \ | 304 | if (ACPI_IS_DEBUG_ENABLED (level, component)) \ |
296 | function (level, line, filename, modulename, component, __VA_ARGS__); \ | 305 | { \ |
297 | } | 306 | function (level, line, filename, modulename, component, __VA_ARGS__); \ |
307 | } \ | ||
308 | }) | ||
298 | 309 | ||
299 | #define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \ | 310 | #define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \ |
300 | ACPI_DEBUG (acpi_debug_print, level, line, filename, modulename, component, __VA_ARGS__) | 311 | ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \ |
312 | filename, modulename, component, __VA_ARGS__) | ||
301 | 313 | ||
302 | #define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \ | 314 | #define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \ |
303 | ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename, component, __VA_ARGS__) | 315 | ACPI_DO_DEBUG_PRINT (acpi_debug_print_raw, level, line, \ |
316 | filename, modulename, component, __VA_ARGS__) | ||
304 | 317 | ||
305 | /* | 318 | /* |
306 | * Function entry tracing | 319 | * Function entry tracing |
@@ -342,16 +355,7 @@ | |||
342 | * | 355 | * |
343 | * One of the FUNCTION_TRACE macros above must be used in conjunction | 356 | * One of the FUNCTION_TRACE macros above must be used in conjunction |
344 | * with these macros so that "_AcpiFunctionName" is defined. | 357 | * with these macros so that "_AcpiFunctionName" is defined. |
345 | * | ||
346 | * Note: the DO_WHILE0 macro is used to prevent some compilers from | ||
347 | * complaining about these constructs. On other compilers the do...while | ||
348 | * adds some extra code, so this feature is optional. | ||
349 | */ | 358 | */ |
350 | #ifdef ACPI_USE_DO_WHILE_0 | ||
351 | #define ACPI_DO_WHILE0(a) do a while(0) | ||
352 | #else | ||
353 | #define ACPI_DO_WHILE0(a) a | ||
354 | #endif | ||
355 | 359 | ||
356 | /* Exit trace helper macro */ | 360 | /* Exit trace helper macro */ |
357 | 361 | ||