[PATCH 2/3] include/linux/logging.h: Reduce data usage of printk_once
From: Joe Perches
Date: Thu Sep 10 2009 - 23:29:55 EST
Use bool for int
Don't initialize __printk_once, invert test
Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
include/linux/logging.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/logging.h b/include/linux/logging.h
index 361d5ed..d76ccfa 100644
--- a/include/linux/logging.h
+++ b/include/linux/logging.h
@@ -91,10 +91,10 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
*/
#define printk_once(fmt, ...) \
({ \
- static int __print_once = 1; \
+ static bool __print_once; \
\
- if (__print_once) { \
- __print_once = 0; \
+ if (!__print_once) { \
+ __print_once = true; \
printk(fmt, ##__VA_ARGS__); \
} \
})
--
1.6.3.1.10.g659a0.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/