diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-10-10 13:30:08 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-10-10 13:30:08 -0400 |
| commit | 3dd392a407d15250a501fa109cc1f93fee95ef85 (patch) | |
| tree | c1faca3fa8bd0f7c8790b3e0887229b4a5a90e8b /include/asm-generic/bug.h | |
| parent | b27a43c1e90582facad44de67d02bc9e9f900289 (diff) | |
| parent | d403a6484f0341bf0624d17ece46f24f741b6a92 (diff) | |
Merge branch 'linus' into x86/pat2
Conflicts:
arch/x86/mm/init_64.c
Diffstat (limited to 'include/asm-generic/bug.h')
| -rw-r--r-- | include/asm-generic/bug.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index a3f738cffdb6..edc6ba82e090 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
| @@ -97,6 +97,16 @@ extern void warn_slowpath(const char *file, const int line, | |||
| 97 | unlikely(__ret_warn_once); \ | 97 | unlikely(__ret_warn_once); \ |
| 98 | }) | 98 | }) |
| 99 | 99 | ||
| 100 | #define WARN_ONCE(condition, format...) ({ \ | ||
| 101 | static int __warned; \ | ||
| 102 | int __ret_warn_once = !!(condition); \ | ||
| 103 | \ | ||
| 104 | if (unlikely(__ret_warn_once)) \ | ||
| 105 | if (WARN(!__warned, format)) \ | ||
| 106 | __warned = 1; \ | ||
| 107 | unlikely(__ret_warn_once); \ | ||
| 108 | }) | ||
| 109 | |||
| 100 | #define WARN_ON_RATELIMIT(condition, state) \ | 110 | #define WARN_ON_RATELIMIT(condition, state) \ |
| 101 | WARN_ON((condition) && __ratelimit(state)) | 111 | WARN_ON((condition) && __ratelimit(state)) |
| 102 | 112 | ||
