datapath: Fix sparse warning on BUILD_BUG_ON_INVALID()
authorAndy Zhou <azhou@nicira.com>
Sat, 21 Dec 2013 00:18:58 +0000 (16:18 -0800)
committerAndy Zhou <azhou@nicira.com>
Sat, 21 Dec 2013 01:58:34 +0000 (17:58 -0800)
Sparse gives the following warnings when compile against Linux kernel
3.5:

 CHECK   /root/projs/ovs/openvswitch/datapath/linux/skbuff-openvswitch.c
 include/linux/mm.h:405:9: error: undefined identifier
 'BUILD_BUG_ON_INVALID'
 include/linux/mm.h:405:9: error: not a function <noident>

The same issue may also exist in kernel 3.6.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-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..6538a22
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __LINUX_BUG_WRAPPER_H
+#define __LINUX_BUG_WRAPPER_H 1
+
+#include_next <linux/bug.h>
+
+#ifdef __CHECKER__
+#ifndef BUILD_BUG_ON_INVALID
+#define  BUILD_BUG_ON_INVALID(e) (0)
+#endif
+
+#endif /* __CHECKER__ */
+
+#endif