From: Johannes Berg Date: Mon, 5 May 2014 12:46:11 +0000 (+0200) Subject: backports: provide net_ieee802154_lowpan only when needed X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fbd854eb7f78fa15fb106ad39544035192193ec5;p=openwrt%2Fstaging%2Fblogic.git backports: provide net_ieee802154_lowpan only when needed If 802.15.4 isn't configured, there's no need to provide the network namespace support for it, so don't. Signed-off-by: Johannes Berg [use IS_ENABLED to hanle CPTCFG_IEEE802154_6LOWPAN=m] Signed-off-by: Hauke Mehrtens --- diff --git a/backport/backport-include/net/net_namespace.h b/backport/backport-include/net/net_namespace.h index 3ea5d4662c27..17c9d554c9c4 100644 --- a/backport/backport-include/net/net_namespace.h +++ b/backport/backport-include/net/net_namespace.h @@ -1,9 +1,11 @@ #ifndef _COMPAT_NET_NET_NAMESPACE_H #define _COMPAT_NET_NET_NAMESPACE_H 1 +#include_next + +#if IS_ENABLED(CPTCFG_IEEE802154_6LOWPAN) #include #include -#include_next #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) @@ -22,5 +24,6 @@ net_ieee802154_lowpan(struct net *net) return &net->ieee802154_lowpan; } #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) */ +#endif /* CPTCFG_IEEE802154_6LOWPAN */ #endif /* _COMPAT_NET_NET_NAMESPACE_H */ diff --git a/backport/compat/backport-3.15.c b/backport/compat/backport-3.15.c index 4094e27c1f6a..5732fa90973e 100644 --- a/backport/compat/backport-3.15.c +++ b/backport/compat/backport-3.15.c @@ -15,6 +15,7 @@ #include #include +#if IS_ENABLED(CPTCFG_IEEE802154_6LOWPAN) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) /* the above kernel dependency is set to match the dependencies file */ struct netns_ieee802154_lowpan ieee802154_lowpan; @@ -26,6 +27,7 @@ struct netns_ieee802154_lowpan *net_ieee802154_lowpan(struct net *net) } EXPORT_SYMBOL_GPL(net_ieee802154_lowpan); #endif +#endif /* CPTCFG_IEEE802154_6LOWPAN */ /** * devm_kstrdup - Allocate resource managed space and