From patchwork Sun Aug 21 22:56:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 292 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sun, 21 Aug 2011 23:03:42 +0000 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.20) for (single-drop); Mon, 22 Aug 2011 10:04:50 -0700 (PDT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QvH3N-0004TR-VR; Sun, 21 Aug 2011 23:03:42 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932076Ab1HUW6d (ORCPT + 1 other); Sun, 21 Aug 2011 18:58:33 -0400 Received: from wondertoys-mx.wondertoys.net ([206.117.179.246]:50366 "EHLO labridge.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756097Ab1HUW6Y (ORCPT ); Sun, 21 Aug 2011 18:58:24 -0400 Received: from [173.60.85.8] (account joe@perches.com HELO joe-laptop.perches.com) by labridge.com (CommuniGate Pro SMTP 5.0.14) with ESMTPA id 18043725; Sun, 21 Aug 2011 15:58:23 -0700 From: Joe Perches To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/14] [media] rc-core.h: Surround macro with do {} while (0) Date: Sun, 21 Aug 2011 15:56:45 -0700 Message-Id: <83cc61d8e120e2b18fe69bc85a6dafe9174ad2be.1313966089.git.joe@perches.com> X-Mailer: git-send-email 1.7.6.405.gc1be0 In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Macros coded with if statements should be do { if... } while (0) so the macros can be used in other if tests. Use ##__VA_ARGS__ for variadic macro as well. Signed-off-by: Joe Perches --- include/media/rc-core.h | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/media/rc-core.h b/include/media/rc-core.h index b1f19b7..b0c494a 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h @@ -23,8 +23,11 @@ #include extern int rc_core_debug; -#define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \ - printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) +#define IR_dprintk(level, fmt, ...) \ +do { \ + if (rc_core_debug >= level) \ + pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \ +} while (0) enum rc_driver_type { RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */