* [PATCH] kernel.h: Remove initialization of bool in printk_once
@ 2009-10-06 21:01 Joe Perches
0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2009-10-06 21:01 UTC (permalink / raw)
To: LKML; +Cc: Andrew Morton
Don't initialize __print_once
Invert the test to reduce initialized data.
defconfig before: $size vmlinux
text data bss dec hex filename
6976022 679572 1359668 9015262 898fde vmlinux
defconfig after: $size vmlinux
text data bss dec hex filename
6976006 679508 1359700 9015214 898fae vmlinux
Signed-off-by: Joe Perches <joe@perches.com>
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d3cd23f..344873d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -252,10 +252,10 @@ extern int printk_delay_msec;
* Print a one-time message (analogous to WARN_ONCE() et al):
*/
#define printk_once(x...) ({ \
- static bool __print_once = true; \
+ static bool __print_once; \
\
- if (__print_once) { \
- __print_once = false; \
+ if (!__print_once) { \
+ __print_once = true; \
printk(x); \
} \
})
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-10-06 21:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-06 21:01 [PATCH] kernel.h: Remove initialization of bool in printk_once Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox