For the unaware, BUG_ON(condition) calls bug on !condition, which is
marked unlikely().
This is the generalized arch-independent BUG_ON as in later 2.5 kernels.
Marcelo, please apply.
Robert Love
--- linux-2.4.18-pre7/include/linux/kernel.h Thu Jan 24 13:48:18 2002
+++ linux/include/linux/kernel.h Fri Jan 25 17:53:54 2002
@@ -11,6 +11,7 @@
#include <linux/linkage.h>
#include <linux/stddef.h>
#include <linux/types.h>
+#include <linux/compiler.h>
/* Optimization barrier */
/* The "volatile" is due to gcc bugs */
@@ -181,4 +182,5 @@
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
};
+#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/