Skip to contentSkip to conversation

batman-adv: fix compat sparse errors for BUILD_BUG_ON in <= 2.6.39

PATCH Applied Simon Wunderlich 2 participants 2 messages Dec 27, 2013 – Dec 28, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: fix compat sparse errors for BUILD_BUG_ON in <= 2.6.39

---
 compat.h |    7 +++++++
 1 file changed, 7 insertions(+)
compat.h +7 -0
index a1c8396..92f88ee 100644
@@ -207,6 +207,13 @@ static inline void skb_reset_mac_len(struct sk_buff *skb)
 	skb->mac_len = skb->network_header - skb->mac_header;
 }
 
+#undef BUILD_BUG_ON
+#ifdef __CHECKER__
+#define BUILD_BUG_ON(condition) (0)
+#else /* __CHECKER__ */
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+#endif /* __CHECKER__ */
+
 #endif /* < KERNEL_VERSION(3, 0, 0) */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
Signature · 1 line
1.7.10.4