aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/bug.h57
1 files changed, 30 insertions, 27 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 7d10f962aa13..7ecd398aebf0 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -106,33 +106,6 @@ extern void warn_slowpath_null(const char *file, const int line);
106 unlikely(__ret_warn_on); \ 106 unlikely(__ret_warn_on); \
107}) 107})
108 108
109#else /* !CONFIG_BUG */
110#ifndef HAVE_ARCH_BUG
111#define BUG() do {} while(0)
112#endif
113
114#ifndef HAVE_ARCH_BUG_ON
115#define BUG_ON(condition) do { if (condition) ; } while(0)
116#endif
117
118#ifndef HAVE_ARCH_WARN_ON
119#define WARN_ON(condition) ({ \
120 int __ret_warn_on = !!(condition); \
121 unlikely(__ret_warn_on); \
122})
123#endif
124
125#ifndef WARN
126#define WARN(condition, format...) ({ \
127 int __ret_warn_on = !!(condition); \
128 unlikely(__ret_warn_on); \
129})
130#endif
131
132#define WARN_TAINT(condition, taint, format...) WARN_ON(condition)
133
134#endif
135
136#define WARN_ON_ONCE(condition) ({ \ 109#define WARN_ON_ONCE(condition) ({ \
137 static bool __section(.data.unlikely) __warned; \ 110 static bool __section(.data.unlikely) __warned; \
138 int __ret_warn_once = !!(condition); \ 111 int __ret_warn_once = !!(condition); \
@@ -163,6 +136,36 @@ extern void warn_slowpath_null(const char *file, const int line);
163 unlikely(__ret_warn_once); \ 136 unlikely(__ret_warn_once); \
164}) 137})
165 138
139#else /* !CONFIG_BUG */
140#ifndef HAVE_ARCH_BUG
141#define BUG() do {} while(0)
142#endif
143
144#ifndef HAVE_ARCH_BUG_ON
145#define BUG_ON(condition) do { if (condition) ; } while(0)
146#endif
147
148#ifndef HAVE_ARCH_WARN_ON
149#define WARN_ON(condition) ({ \
150 int __ret_warn_on = !!(condition); \
151 unlikely(__ret_warn_on); \
152})
153#endif
154
155#ifndef WARN
156#define WARN(condition, format...) ({ \
157 int __ret_warn_on = !!(condition); \
158 unlikely(__ret_warn_on); \
159})
160#endif
161
162#define WARN_ON_ONCE(condition) WARN_ON(condition)
163#define WARN_ONCE(condition, format...) WARN(condition, format)
164#define WARN_TAINT(condition, taint, format...) WARN(condition, format)
165#define WARN_TAINT_ONCE(condition, taint, format...) WARN(condition, format)
166
167#endif
168
166/* 169/*
167 * WARN_ON_SMP() is for cases that the warning is either 170 * WARN_ON_SMP() is for cases that the warning is either
168 * meaningless for !SMP or may even cause failures. 171 * meaningless for !SMP or may even cause failures.