aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/lib.h
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-03-27 15:53:45 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-03-27 15:53:45 +0100
commit9726237543394a5cf7b96bd76a9ccdcbe075e7e6 (patch)
tree0380f065e34e2fa90a683c8eec976f9fbeb24fdf /xen/include/xen/lib.h
parentaacef84b337c59c447472f9102f270e3887254cd (diff)
downloadxen-9726237543394a5cf7b96bd76a9ccdcbe075e7e6.tar.gz
xen-9726237543394a5cf7b96bd76a9ccdcbe075e7e6.tar.bz2
xen-9726237543394a5cf7b96bd76a9ccdcbe075e7e6.zip
Add WARN() and generic WARN_ON().
Based on a patch by Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/lib.h')
-rw-r--r--xen/include/xen/lib.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index f5f59441f1..3145542b25 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -10,8 +10,10 @@
#include <asm/bug.h>
void __bug(char *file, int line) __attribute__((noreturn));
+void __warn(char *file, int line);
-#define BUG_ON(_p) do { if (_p) BUG(); } while ( 0 )
+#define BUG_ON(p) do { if (p) BUG(); } while (0)
+#define WARN_ON(p) do { if (p) WARN(); } while (0)
/* Force a compilation error if condition is true */
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2 * !!(condition)]))