]> git.karo-electronics.de Git - karo-tx-linux.git/blob - tools/include/asm/bug.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[karo-tx-linux.git] / tools / include / asm / bug.h
1 #ifndef _TOOLS_ASM_BUG_H
2 #define _TOOLS_ASM_BUG_H
3
4 #include <linux/compiler.h>
5
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 })
24
25 #endif /* _TOOLS_ASM_BUG_H */