aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-07 15:19:17 +0200
committerTakashi Iwai <tiwai@suse.de>2013-10-07 15:19:33 +0200
commit0b77375cbfac54f0d58b8c6665812883984df48a (patch)
treebb2570dbff6751710a6958c28daac5e8f9488169
parent9e150ad50523b8d3bdad3c39ad2b34b05f8ec892 (diff)
downloadhda-emu-0b77375cbfac54f0d58b8c6665812883984df48a.tar.gz
Add WARN_ON() wrapper
-rw-r--r--include/wrapper.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/wrapper.h b/include/wrapper.h
index 952fae0..5871410 100644
--- a/include/wrapper.h
+++ b/include/wrapper.h
@@ -167,6 +167,15 @@ static inline bool time_before(unsigned long a, unsigned long b)
#define BUILD_BUG_ON(x) do {} while (0)
+static inline int _WARN_ON(int cond, const char *func, int line)
+{
+ if (cond)
+ printk(KERN_ERR "WARNING! (%s:%d)\n", func, line);
+ return cond;
+}
+
+#define WARN_ON(cond) _WARN_ON(cond, __func__, __LINE__)
+
#define simple_strtoul strtoul
#define simple_strtol strtol