Add patches accepted for 2.6.30-rc1
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.30-rc1 / 0006-thinkpad-acpi-cleanup-debug-helpers.patch
blob4ad47593de783a1ac050f5127a22c25ec093d2a6
1 From 3dcc2c3b00cad01a0e3667607f8644e891e4dc8b Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Sat, 4 Apr 2009 04:25:45 +0000
4 Subject: thinkpad-acpi: cleanup debug helpers
6 Fix the vdbg_printk macro definition to be sane when
7 CONFIG_THINKPAD_ACPI_DEBUG is undefined, and move the mess into a file
8 section of its own.
10 This doesn't change anything in the current code, but future code will
11 need the proper behaviour.
13 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
14 Signed-off-by: Len Brown <len.brown@intel.com>
15 ---
16 drivers/platform/x86/thinkpad_acpi.c | 29 ++++++++++++++++++-----------
17 1 files changed, 18 insertions(+), 11 deletions(-)
19 diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
20 index c83ec94..3367df9 100644
21 --- a/drivers/platform/x86/thinkpad_acpi.c
22 +++ b/drivers/platform/x86/thinkpad_acpi.c
23 @@ -184,17 +184,6 @@ enum {
24 #define TPACPI_DBG_ALL 0xffff
25 #define TPACPI_DBG_INIT 0x0001
26 #define TPACPI_DBG_EXIT 0x0002
27 -#define dbg_printk(a_dbg_level, format, arg...) \
28 - do { if (dbg_level & a_dbg_level) \
29 - printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \
30 - } while (0)
31 -#ifdef CONFIG_THINKPAD_ACPI_DEBUG
32 -#define vdbg_printk(a_dbg_level, format, arg...) \
33 - dbg_printk(a_dbg_level, format, ## arg)
34 -static const char *str_supported(int is_supported);
35 -#else
36 -#define vdbg_printk(a_dbg_level, format, arg...)
37 -#endif
39 #define onoff(status, bit) ((status) & (1 << (bit)) ? "on" : "off")
40 #define enabled(status, bit) ((status) & (1 << (bit)) ? "enabled" : "disabled")
41 @@ -326,6 +315,24 @@ static int tpacpi_uwb_emulstate;
42 #endif
45 +/*************************************************************************
46 + * Debugging helpers
47 + */
49 +#define dbg_printk(a_dbg_level, format, arg...) \
50 + do { if (dbg_level & (a_dbg_level)) \
51 + printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \
52 + } while (0)
54 +#ifdef CONFIG_THINKPAD_ACPI_DEBUG
55 +#define vdbg_printk dbg_printk
56 +static const char *str_supported(int is_supported);
57 +#else
58 +#define vdbg_printk(a_dbg_level, format, arg...) \
59 + do { } while (0)
60 +#endif
63 /****************************************************************************
64 ****************************************************************************
66 --
67 1.6.2.1