Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242507
b: refs/heads/master
c: 2092e6b
h: refs/heads/master
i:
  242505: 01a1c63
  242503: 102a54d
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Mar 25, 2011
1 parent 4f0c318 commit 0e93680
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 71f9e59800e5ad4e6b683348424c9fe54306cd43
refs/heads/master: 2092e6be82ec71ecbf5a8ceeef004bbcbdb78812
28 changes: 27 additions & 1 deletion trunk/include/asm-generic/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,36 @@ extern void warn_slowpath_null(const char *file, const int line);
#define WARN_ON_RATELIMIT(condition, state) \
WARN_ON((condition) && __ratelimit(state))

/*
* WARN_ON_SMP() is for cases that the warning is either
* meaningless for !SMP or may even cause failures.
* This is usually used for cases that we have
* WARN_ON(!spin_is_locked(&lock)) checks, as spin_is_locked()
* returns 0 for uniprocessor settings.
* It can also be used with values that are only defined
* on SMP:
*
* struct foo {
* [...]
* #ifdef CONFIG_SMP
* int bar;
* #endif
* };
*
* void func(struct foo *zoot)
* {
* WARN_ON_SMP(!zoot->bar);
*
* For CONFIG_SMP, WARN_ON_SMP() should act the same as WARN_ON(),
* and should be a nop and return false for uniprocessor.
*
* if (WARN_ON_SMP(x)) returns true only when CONFIG_SMP is set
* and x is true.
*/
#ifdef CONFIG_SMP
# define WARN_ON_SMP(x) WARN_ON(x)
#else
# define WARN_ON_SMP(x) do { } while (0)
# define WARN_ON_SMP(x) ({0;})
#endif

#endif

0 comments on commit 0e93680

Please sign in to comment.