diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/bug.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 0cd9711895fa..845cb67ad8ea 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -38,4 +38,17 @@ | |||
38 | #endif | 38 | #endif |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #define WARN_ON_ONCE(condition) \ | ||
42 | ({ \ | ||
43 | static int __warn_once = 1; \ | ||
44 | int __ret = 0; \ | ||
45 | \ | ||
46 | if (unlikely((condition) && __warn_once)) { \ | ||
47 | __warn_once = 0; \ | ||
48 | WARN_ON(1); \ | ||
49 | __ret = 1; \ | ||
50 | } \ | ||
51 | __ret; \ | ||
52 | }) | ||
53 | |||
41 | #endif | 54 | #endif |