From 7c359202cff3178e7ac22e29714c2983bb585076 Mon Sep 17 00:00:00 2001 From: Andy Zhou Date: Fri, 20 Dec 2013 16:18:58 -0800 Subject: [PATCH] datapath: Fix sparse warning on BUILD_BUG_ON_INVALID() 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 The same issue may also exist in kernel 3.6. Signed-off-by: Andy Zhou Acked-by: Pravin B Shelar --- datapath/linux/compat/include/linux/bug.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 datapath/linux/compat/include/linux/bug.h diff --git a/datapath/linux/compat/include/linux/bug.h b/datapath/linux/compat/include/linux/bug.h new file mode 100644 index 000000000..6538a22fc --- /dev/null +++ b/datapath/linux/compat/include/linux/bug.h @@ -0,0 +1,13 @@ +#ifndef __LINUX_BUG_WRAPPER_H +#define __LINUX_BUG_WRAPPER_H 1 + +#include_next + +#ifdef __CHECKER__ +#ifndef BUILD_BUG_ON_INVALID +#define BUILD_BUG_ON_INVALID(e) (0) +#endif + +#endif /* __CHECKER__ */ + +#endif -- 2.20.1