datapath: Add missing bug.h file
authorPravin B Shelar <pshelar@nicira.com>
Mon, 5 Nov 2012 23:12:59 +0000 (15:12 -0800)
committerPravin B Shelar <pshelar@nicira.com>
Mon, 5 Nov 2012 23:12:59 +0000 (15:12 -0800)
Commit 51f4701be1 (datapath: Fix sparse warning for symbol
'BUILD_BUG_ON_NOT_POWER_OF_2') missed file bug.h. Commiting it now.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
datapath/linux/compat/include/linux/bug.h [new file with mode: 0644]

diff --git a/datapath/linux/compat/include/linux/bug.h b/datapath/linux/compat/include/linux/bug.h
new file mode 100644 (file)
index 0000000..d24e68e
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef __BUG_H_WRAPPER
+#define __BUG_H_WRAPPER 1
+
+#include_next <linux/bug.h>
+
+#ifndef BUILD_BUG_ON_NOT_POWER_OF_2
+/* Force a compilation error if a constant expression is not a power of 2 */
+#define BUILD_BUG_ON_NOT_POWER_OF_2(n)                 \
+       BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
+#endif
+
+#endif