aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/bug.h
diff options
context:
space:
mode:
authorCesar Eduardo Barros <cesarb@cesarb.net>2009-12-14 21:00:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-15 11:53:25 -0500
commit42f247c83aeb52d2ee7a9fe23fb57e22317f18fd (patch)
treecd48934d6f634ba4f0eec4ed2da37f9bfe3a82c5 /include/asm-generic/bug.h
parent6613c5e8603bc41741487828f48c6a4d701f7814 (diff)
WARN_ONCE(): use bool for boolean flag
Commit 70867453092297be9afb2249e712a1f960ec0a09 ("printk_once(): use bool for boolean flag") changed printk_once() to use bool instead of int for its guard variable. Do the same change to WARN_ONCE() and WARN_ON_ONCE(), for the same reasons. This resulted in a reduction of 1462 bytes on a x86-64 defconfig: text data bss dec hex filename 8101271 1207116 992764 10301151 9d2edf vmlinux.before 8100553 1207148 991988 10299689 9d2929 vmlinux.after Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net> Cc: Roland Dreier <rolandd@cisco.com> Cc: Daniel Walker <dwalker@fifo99.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/bug.h')
-rw-r--r--include/asm-generic/bug.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 4b6755984d24..18c435d7c082 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -113,22 +113,22 @@ extern void warn_slowpath_null(const char *file, const int line);
113#endif 113#endif
114 114
115#define WARN_ON_ONCE(condition) ({ \ 115#define WARN_ON_ONCE(condition) ({ \
116 static int __warned; \ 116 static bool __warned; \
117 int __ret_warn_once = !!(condition); \ 117 int __ret_warn_once = !!(condition); \
118 \ 118 \
119 if (unlikely(__ret_warn_once)) \ 119 if (unlikely(__ret_warn_once)) \
120 if (WARN_ON(!__warned)) \ 120 if (WARN_ON(!__warned)) \
121 __warned = 1; \ 121 __warned = true; \
122 unlikely(__ret_warn_once); \ 122 unlikely(__ret_warn_once); \
123}) 123})
124 124
125#define WARN_ONCE(condition, format...) ({ \ 125#define WARN_ONCE(condition, format...) ({ \
126 static int __warned; \ 126 static bool __warned; \
127 int __ret_warn_once = !!(condition); \ 127 int __ret_warn_once = !!(condition); \
128 \ 128 \
129 if (unlikely(__ret_warn_once)) \ 129 if (unlikely(__ret_warn_once)) \
130 if (WARN(!__warned, format)) \ 130 if (WARN(!__warned, format)) \
131 __warned = 1; \ 131 __warned = true; \
132 unlikely(__ret_warn_once); \ 132 unlikely(__ret_warn_once); \
133}) 133})
134 134