From fe702bcbdcc600f995d6213fa2ac34d3d5b9c09c Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 2 Apr 2013 01:01:31 +0200 Subject: [PATCH] add a few compile time checks Do a few sanity checks at compile time. Actually it would be possible to do them at Kconfig time and simply disable mac80211/cfg80211, but that wouldn't be very discoverable, and it's a corner case anyway. Signed-off-by: Johannes Berg --- compat/include/linux/backport_checks.h | 16 ++++++++++++++++ compat/include/linux/compat-2.6.h | 1 + 2 files changed, 17 insertions(+) create mode 100644 compat/include/linux/backport_checks.h diff --git a/compat/include/linux/backport_checks.h b/compat/include/linux/backport_checks.h new file mode 100644 index 000000000000..6244559a5cef --- /dev/null +++ b/compat/include/linux/backport_checks.h @@ -0,0 +1,16 @@ +#ifndef __BACKPORT_CHECKS +#define __BACKPORT_CHECKS + +#if defined(CPTCFG_BACKPORT_KERNEL_2_6_28) && defined(CONFIG_DYNAMIC_FTRACE) +#error "You can't build on a 2.6.27 or older kernel with dynamic ftrace, it's broken" +#endif + +#if defined(CONFIG_MAC80211) && defined(CPTCFG_MAC80211) +#error "You must not have mac80211 built into your kernel if you want to enable it" +#endif + +#if defined(CONFIG_CFG80211) && defined(CPTCFG_CFG80211) +#error "You must not have cfg80211 built into your kernel if you want to enable it" +#endif + +#endif /* __BACKPORT_CHECKS */ diff --git a/compat/include/linux/compat-2.6.h b/compat/include/linux/compat-2.6.h index 1e9effb70442..57a1c134a952 100644 --- a/compat/include/linux/compat-2.6.h +++ b/compat/include/linux/compat-2.6.h @@ -4,6 +4,7 @@ #ifndef __ASSEMBLY__ #define LINUX_BACKPORT(__sym) backport_ ##__sym +#include #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) -- 2.30.2