All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Olof Johansson <olof@lixom.net>, Tejun Heo <tj@kernel.org>
Cc: x86@kernel.org, hpa@zytor.com, mingo@elte.hu, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, matt.fleming@intel.com,
	mjg@redhat.com
Subject: [PATCH] memblock: Make memblock_dbg macro safer
Date: Sun, 12 Feb 2012 13:59:37 -0800	[thread overview]
Message-ID: <1329083977.15485.6.camel@joe2Laptop> (raw)
In-Reply-To: <1329081869-20779-3-git-send-email-olof@lixom.net>

Allow this macro to be used in an if/else block.

Use do {} while (0) and pr_info. (perhaps this should be pr_debug)

Signed-off-by: Joe Perches <joe@perches.com>
---
 include/linux/memblock.h |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index a6bb102..0584d13 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -43,8 +43,11 @@ struct memblock {
 extern struct memblock memblock;
 extern int memblock_debug;
 
-#define memblock_dbg(fmt, ...) \
-	if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
+#define memblock_dbg(fmt, ...)					\
+do {								\
+	if (memblock_debug)					\
+		pr_info(fmt, ##__VA_ARGS__);			\
+} while (0)
 
 phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end,
 				phys_addr_t size, phys_addr_t align, int nid);



  reply	other threads:[~2012-02-12 21:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-12 21:24 [PATCH v5 0/5] x86: efi: cleanups and basic 32/64-bit support Olof Johansson
2012-02-12 21:24 ` [PATCH v5 1/5] x86: efi: refactor efi_init() a bit Olof Johansson
2012-02-28  2:43   ` [tip:x86/eficross] x86, efi: Refactor " tip-bot for Olof Johansson
2012-02-12 21:24 ` [PATCH v5 2/5] x86: efi: convert printk to pr_*() Olof Johansson
2012-02-12 21:59   ` Joe Perches [this message]
2012-02-28  2:44   ` [tip:x86/eficross] x86, efi: Convert " tip-bot for Olof Johansson
2012-02-12 21:24 ` [PATCH v5 3/5] x86: efi: cleanup config table walking Olof Johansson
2012-02-28  2:45   ` [tip:x86/eficross] x86, efi: Cleanup " tip-bot for Olof Johansson
2012-02-12 21:24 ` [PATCH v5 4/5] x86: efi: add basic error handling Olof Johansson
2012-02-28  2:46   ` [tip:x86/eficross] x86, efi: Add " tip-bot for Olof Johansson
2012-02-12 21:24 ` [PATCH v5 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Olof Johansson
2012-02-15 13:33   ` Matt Fleming
2012-02-28  2:46   ` [tip:x86/eficross] x86, efi: Allow basic init with mixed 32/ 64-bit efi/kernel tip-bot for Olof Johansson
2012-03-12 14:24   ` [PATCH v5 5/5] x86: efi: allow basic init with mixed 32/64-bit efi/kernel Matthew Garrett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329083977.15485.6.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@elte.hu \
    --cc=mjg@redhat.com \
    --cc=olof@lixom.net \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.