mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
741a0c5903
Since it uses unlikely() macro inside WARN() Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1389276059-8829-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
26 lines
596 B
C
26 lines
596 B
C
#ifndef _TOOLS_ASM_BUG_H
|
|
#define _TOOLS_ASM_BUG_H
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
#define __WARN_printf(arg...) do { fprintf(stderr, arg); } while (0)
|
|
|
|
#define WARN(condition, format...) ({ \
|
|
int __ret_warn_on = !!(condition); \
|
|
if (unlikely(__ret_warn_on)) \
|
|
__WARN_printf(format); \
|
|
unlikely(__ret_warn_on); \
|
|
})
|
|
|
|
#define WARN_ONCE(condition, format...) ({ \
|
|
static int __warned; \
|
|
int __ret_warn_once = !!(condition); \
|
|
\
|
|
if (unlikely(__ret_warn_once)) \
|
|
if (WARN(!__warned, format)) \
|
|
__warned = 1; \
|
|
unlikely(__ret_warn_once); \
|
|
})
|
|
|
|
#endif /* _TOOLS_ASM_BUG_H */
|