From patchwork Sat Apr 4 04:25:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrique de Moraes Holschuh X-Patchwork-Id: 16292 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n344Q6XM009928 for ; Sat, 4 Apr 2009 04:26:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751198AbZDDE0H (ORCPT ); Sat, 4 Apr 2009 00:26:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751450AbZDDE0D (ORCPT ); Sat, 4 Apr 2009 00:26:03 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:42669 "EHLO out2.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751198AbZDDE0A (ORCPT ); Sat, 4 Apr 2009 00:26:00 -0400 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id EDB6630F6C0; Sat, 4 Apr 2009 00:25:58 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Sat, 04 Apr 2009 00:25:58 -0400 X-Sasl-enc: Nm+0Nrq1Y7L72/rAqtkme6Z0onFHwDIB+MzZUjqJ0dmr 1238819158 Received: from khazad-dum.debian.net (unknown [201.82.166.239]) by mail.messagingengine.com (Postfix) with ESMTPSA id 956DD2A793; Sat, 4 Apr 2009 00:25:58 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by localhost.khazad-dum.debian.net (Postfix) with ESMTP id 454872821C; Sat, 4 Apr 2009 01:25:55 -0300 (BRT) X-Virus-Scanned: Debian amavisd-new at khazad-dum.debian.net Received: from khazad-dum.debian.net ([127.0.0.1]) by localhost (khazad-dum.debian.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TF3JbsqaI510; Sat, 4 Apr 2009 01:25:54 -0300 (BRT) Received: by khazad-dum.debian.net (Postfix, from userid 1000) id 9FBE82822A; Sat, 4 Apr 2009 01:25:53 -0300 (BRT) From: Henrique de Moraes Holschuh To: Len Brown Cc: linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, Henrique de Moraes Holschuh Subject: [PATCH 04/12] thinkpad-acpi: cleanup debug helpers Date: Sat, 4 Apr 2009 01:25:45 -0300 Message-Id: <1238819153-16004-5-git-send-email-hmh@hmh.eng.br> X-Mailer: git-send-email 1.6.2.1 In-Reply-To: <1238819153-16004-1-git-send-email-hmh@hmh.eng.br> References: <1238819153-16004-1-git-send-email-hmh@hmh.eng.br> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- 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 5fd5549..0a01f76 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -184,17 +184,6 @@ enum { #define TPACPI_DBG_ALL 0xffff #define TPACPI_DBG_INIT 0x0001 #define TPACPI_DBG_EXIT 0x0002 -#define dbg_printk(a_dbg_level, format, arg...) \ - do { if (dbg_level & a_dbg_level) \ - printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \ - } while (0) -#ifdef CONFIG_THINKPAD_ACPI_DEBUG -#define vdbg_printk(a_dbg_level, format, arg...) \ - dbg_printk(a_dbg_level, format, ## arg) -static const char *str_supported(int is_supported); -#else -#define vdbg_printk(a_dbg_level, format, arg...) -#endif #define onoff(status, bit) ((status) & (1 << (bit)) ? "on" : "off") #define enabled(status, bit) ((status) & (1 << (bit)) ? "enabled" : "disabled") @@ -326,6 +315,24 @@ static int tpacpi_uwb_emulstate; #endif +/************************************************************************* + * Debugging helpers + */ + +#define dbg_printk(a_dbg_level, format, arg...) \ + do { if (dbg_level & (a_dbg_level)) \ + printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \ + } while (0) + +#ifdef CONFIG_THINKPAD_ACPI_DEBUG +#define vdbg_printk dbg_printk +static const char *str_supported(int is_supported); +#else +#define vdbg_printk(a_dbg_level, format, arg...) \ + do { } while (0) +#endif + + /**************************************************************************** **************************************************************************** *