]>
Commit | Line | Data |
---|---|---|
02dfc8d7 NK |
1 | #ifndef _TOOLS_ASM_BUG_H |
2 | #define _TOOLS_ASM_BUG_H | |
b32d133a | 3 | |
741a0c59 NK |
4 | #include <linux/compiler.h> |
5 | ||
b32d133a ACM |
6 | #define __WARN_printf(arg...) do { fprintf(stderr, arg); } while (0) |
7 | ||
8 | #define WARN(condition, format...) ({ \ | |
9 | int __ret_warn_on = !!(condition); \ | |
10 | if (unlikely(__ret_warn_on)) \ | |
11 | __WARN_printf(format); \ | |
12 | unlikely(__ret_warn_on); \ | |
13 | }) | |
14 | ||
15 | #define WARN_ONCE(condition, format...) ({ \ | |
16 | static int __warned; \ | |
17 | int __ret_warn_once = !!(condition); \ | |
18 | \ | |
19 | if (unlikely(__ret_warn_once)) \ | |
20 | if (WARN(!__warned, format)) \ | |
21 | __warned = 1; \ | |
22 | unlikely(__ret_warn_once); \ | |
23 | }) | |
02dfc8d7 NK |
24 | |
25 | #endif /* _TOOLS_ASM_BUG_H */ |