aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-25 20:52:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-25 20:52:22 -0400
commit94df491c4a01b39d81279a68386158eb02656712 (patch)
treeba431d9d74f11a7117883df54908ea39e4ef7c5c /include/asm-generic
parent26ff6801f751cd47e44c2e9507ec08b447f2d2b9 (diff)
parent29096202176ceaa5016a17ea2dd1aea19a4e90e2 (diff)
Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: futex: Fix WARN_ON() test for UP WARN_ON_SMP(): Allow use in if() statements on UP x86, dumpstack: Use %pB format specifier for stack trace vsprintf: Introduce %pB format specifier lockdep: Remove unused 'factor' variable from lockdep_stats_show()
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/bug.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index c2c9ba032d46..f2d2faf4d9ae 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -165,10 +165,36 @@ extern void warn_slowpath_null(const char *file, const int line);
165#define WARN_ON_RATELIMIT(condition, state) \ 165#define WARN_ON_RATELIMIT(condition, state) \
166 WARN_ON((condition) && __ratelimit(state)) 166 WARN_ON((condition) && __ratelimit(state))
167 167
168/*
169 * WARN_ON_SMP() is for cases that the warning is either
170 * meaningless for !SMP or may even cause failures.
171 * This is usually used for cases that we have
172 * WARN_ON(!spin_is_locked(&lock)) checks, as spin_is_locked()
173 * returns 0 for uniprocessor settings.
174 * It can also be used with values that are only defined
175 * on SMP:
176 *
177 * struct foo {
178 * [...]
179 * #ifdef CONFIG_SMP
180 * int bar;
181 * #endif
182 * };
183 *
184 * void func(struct foo *zoot)
185 * {
186 * WARN_ON_SMP(!zoot->bar);
187 *
188 * For CONFIG_SMP, WARN_ON_SMP() should act the same as WARN_ON(),
189 * and should be a nop and return false for uniprocessor.
190 *
191 * if (WARN_ON_SMP(x)) returns true only when CONFIG_SMP is set
192 * and x is true.
193 */
168#ifdef CONFIG_SMP 194#ifdef CONFIG_SMP
169# define WARN_ON_SMP(x) WARN_ON(x) 195# define WARN_ON_SMP(x) WARN_ON(x)
170#else 196#else
171# define WARN_ON_SMP(x) do { } while (0) 197# define WARN_ON_SMP(x) ({0;})
172#endif 198#endif
173 199
174#endif 200#endif