diff options
Diffstat (limited to 'tools/include/asm/bug.h')
-rw-r--r-- | tools/include/asm/bug.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/include/asm/bug.h b/tools/include/asm/bug.h index 9e5f4846967f..beda1a884b50 100644 --- a/tools/include/asm/bug.h +++ b/tools/include/asm/bug.h | |||
@@ -12,6 +12,17 @@ | |||
12 | unlikely(__ret_warn_on); \ | 12 | unlikely(__ret_warn_on); \ |
13 | }) | 13 | }) |
14 | 14 | ||
15 | #define WARN_ON_ONCE(condition) ({ \ | ||
16 | static int __warned; \ | ||
17 | int __ret_warn_once = !!(condition); \ | ||
18 | \ | ||
19 | if (unlikely(__ret_warn_once && !__warned)) { \ | ||
20 | __warned = true; \ | ||
21 | WARN_ON(1); \ | ||
22 | } \ | ||
23 | unlikely(__ret_warn_once); \ | ||
24 | }) | ||
25 | |||
15 | #define WARN_ONCE(condition, format...) ({ \ | 26 | #define WARN_ONCE(condition, format...) ({ \ |
16 | static int __warned; \ | 27 | static int __warned; \ |
17 | int __ret_warn_once = !!(condition); \ | 28 | int __ret_warn_once = !!(condition); \ |