lkml.org 
[lkml]   [2012]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/5] printk: Add eliminated_printk macro
Date
no_printk keeps gcc side-effects.
Add a mechanism to eliminate the side-effects.

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

diff --git a/include/linux/printk.h b/include/linux/printk.h
index 1bec2f7..84aa910 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -88,6 +88,16 @@ int no_printk(const char *fmt, ...)
return 0;
}

+/*
+ * Dummy printk for disabled printks maintaining
+ * gcc's format checking and eliminating side-effects
+ */
+#define eliminated_printk(fmt, ...) \
+do { \
+ if (0) \
+ printk(fmt, ##__VA_ARGS__); \
+} while (0)
+
extern asmlinkage __printf(1, 2)
void early_printk(const char *fmt, ...);

--
1.7.8.111.gad25c.dirty


\
 
 \ /
  Last update: 2012-06-18 05:21    [W:0.099 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site