diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 4d356e168692514c3e09e4686289693ab8b74579..40373920ea58a3e8be894c9b08725d562aa4fc28 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h @@ -113,10 +113,12 @@ extern void aarp_proto_init(void); /* Inter module exports */ /* Give a device find its atif control structure */ +#if IS_ENABLED(CONFIG_IRDA) || IS_ENABLED(CONFIG_ATALK) static inline struct atalk_iface *atalk_find_dev(struct net_device *dev) { return dev->atalk_ptr; } +#endif extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev); extern struct net_device *atrtr_get_dev(struct atalk_addr *sa); diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 5eef6c8e274199d4f37e30cb463fc19d13868b3c..dbe6344b727ac60cdc6bf85a38632a1a5a6f890d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1798,11 +1798,17 @@ struct net_device { #if IS_ENABLED(CONFIG_TIPC) struct tipc_bearer __rcu *tipc_ptr; #endif +#if IS_ENABLED(CONFIG_IRDA) || IS_ENABLED(CONFIG_ATALK) void *atalk_ptr; +#endif struct in_device __rcu *ip_ptr; +#if IS_ENABLED(CONFIG_DECNET) struct dn_dev __rcu *dn_ptr; +#endif struct inet6_dev __rcu *ip6_ptr; +#if IS_ENABLED(CONFIG_AX25) void *ax25_ptr; +#endif struct wireless_dev *ieee80211_ptr; struct wpan_dev *ieee802154_ptr; #if IS_ENABLED(CONFIG_MPLS_ROUTING) diff --git a/include/net/ax25.h b/include/net/ax25.h index 76fb39c272a78d614ba0e7176c4f1b9811d437fc..c91bc87931c772d8b52e3d0b9efbf7dbd714eb6c 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -318,10 +318,12 @@ void ax25_digi_invert(const ax25_digi *, ax25_digi *); extern ax25_dev *ax25_dev_list; extern spinlock_t ax25_dev_lock; +#if IS_ENABLED(CONFIG_AX25) static inline ax25_dev *ax25_dev_ax25dev(struct net_device *dev) { return dev->ax25_ptr; } +#endif ax25_dev *ax25_addr_ax25dev(ax25_address *); void ax25_dev_device_up(struct net_device *); diff --git a/net/core/dev.c b/net/core/dev.c index df5241c8eda1ad1be45a09b5649347f67a7f2763..4bd4ad7ffda4cf56314e3e4a7f9b1ddc7412f3db 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -8134,8 +8134,9 @@ void netdev_run_todo(void) BUG_ON(!list_empty(&dev->ptype_specific)); WARN_ON(rcu_access_pointer(dev->ip_ptr)); WARN_ON(rcu_access_pointer(dev->ip6_ptr)); +#if IS_ENABLED(CONFIG_DECNET) WARN_ON(dev->dn_ptr); - +#endif if (dev->priv_destructor) dev->priv_destructor(dev); if (dev->needs_free_netdev) diff --git a/net/socket.c b/net/socket.c index fac8246a8ae8ee9e839ad2047dea10bc81ea8eca..d83e804d5e65c75106e3d55715a7d51231dd49e4 100644 --- a/net/socket.c +++ b/net/socket.c @@ -104,7 +104,6 @@ #include #include #include -#include #include #include