diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2009-04-04 00:25:45 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-04 03:14:52 -0400 |
commit | 3dcc2c3b00cad01a0e3667607f8644e891e4dc8b (patch) | |
tree | 60f40cef65ff215d86863b05db5fde65ccf1644b /drivers/platform | |
parent | 078ac19ed8f476a7c2d729712e15f5ab516ff491 (diff) |
thinkpad-acpi: cleanup debug helpers
Fix the vdbg_printk macro definition to be sane when
CONFIG_THINKPAD_ACPI_DEBUG is undefined, and move the mess into a file
section of its own.
This doesn't change anything in the current code, but future code will
need the proper behaviour.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index c83ec94eb8d9..3367df9d4f99 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -184,17 +184,6 @@ enum { | |||
184 | #define TPACPI_DBG_ALL 0xffff | 184 | #define TPACPI_DBG_ALL 0xffff |
185 | #define TPACPI_DBG_INIT 0x0001 | 185 | #define TPACPI_DBG_INIT 0x0001 |
186 | #define TPACPI_DBG_EXIT 0x0002 | 186 | #define TPACPI_DBG_EXIT 0x0002 |
187 | #define dbg_printk(a_dbg_level, format, arg...) \ | ||
188 | do { if (dbg_level & a_dbg_level) \ | ||
189 | printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \ | ||
190 | } while (0) | ||
191 | #ifdef CONFIG_THINKPAD_ACPI_DEBUG | ||
192 | #define vdbg_printk(a_dbg_level, format, arg...) \ | ||
193 | dbg_printk(a_dbg_level, format, ## arg) | ||
194 | static const char *str_supported(int is_supported); | ||
195 | #else | ||
196 | #define vdbg_printk(a_dbg_level, format, arg...) | ||
197 | #endif | ||
198 | 187 | ||
199 | #define onoff(status, bit) ((status) & (1 << (bit)) ? "on" : "off") | 188 | #define onoff(status, bit) ((status) & (1 << (bit)) ? "on" : "off") |
200 | #define enabled(status, bit) ((status) & (1 << (bit)) ? "enabled" : "disabled") | 189 | #define enabled(status, bit) ((status) & (1 << (bit)) ? "enabled" : "disabled") |
@@ -326,6 +315,24 @@ static int tpacpi_uwb_emulstate; | |||
326 | #endif | 315 | #endif |
327 | 316 | ||
328 | 317 | ||
318 | /************************************************************************* | ||
319 | * Debugging helpers | ||
320 | */ | ||
321 | |||
322 | #define dbg_printk(a_dbg_level, format, arg...) \ | ||
323 | do { if (dbg_level & (a_dbg_level)) \ | ||
324 | printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \ | ||
325 | } while (0) | ||
326 | |||
327 | #ifdef CONFIG_THINKPAD_ACPI_DEBUG | ||
328 | #define vdbg_printk dbg_printk | ||
329 | static const char *str_supported(int is_supported); | ||
330 | #else | ||
331 | #define vdbg_printk(a_dbg_level, format, arg...) \ | ||
332 | do { } while (0) | ||
333 | #endif | ||
334 | |||
335 | |||
329 | /**************************************************************************** | 336 | /**************************************************************************** |
330 | **************************************************************************** | 337 | **************************************************************************** |
331 | * | 338 | * |