lkml.org 
[lkml]   [2012]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] memblock: Make memblock_dbg macro safer
From
Date
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);



\
 
 \ /
  Last update: 2012-02-12 23:03    [W:0.079 / U:1.308 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site