Skip to content

Commit 1d63158

Browse files
committed
Merge branch 'net-dev-Make-protocol-ptr-dependent-on-CONFIG'
David Ahern says: ==================== net: dev: Make protocol ptr dependent on CONFIG Found these in a branch from 3-years ago. Still relevant today. Make decnet, ax25, and atalk ptrs in net_device based on their respective CONFIG. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 7707968 + e92bad5 commit 1d63158

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

include/linux/atalk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ extern void aarp_proto_init(void);
113113
/* Inter module exports */
114114

115115
/* Give a device find its atif control structure */
116+
#if IS_ENABLED(CONFIG_IRDA) || IS_ENABLED(CONFIG_ATALK)
116117
static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
117118
{
118119
return dev->atalk_ptr;
119120
}
121+
#endif
120122

121123
extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev);
122124
extern struct net_device *atrtr_get_dev(struct atalk_addr *sa);

include/linux/netdevice.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,11 +1798,17 @@ struct net_device {
17981798
#if IS_ENABLED(CONFIG_TIPC)
17991799
struct tipc_bearer __rcu *tipc_ptr;
18001800
#endif
1801+
#if IS_ENABLED(CONFIG_IRDA) || IS_ENABLED(CONFIG_ATALK)
18011802
void *atalk_ptr;
1803+
#endif
18021804
struct in_device __rcu *ip_ptr;
1805+
#if IS_ENABLED(CONFIG_DECNET)
18031806
struct dn_dev __rcu *dn_ptr;
1807+
#endif
18041808
struct inet6_dev __rcu *ip6_ptr;
1809+
#if IS_ENABLED(CONFIG_AX25)
18051810
void *ax25_ptr;
1811+
#endif
18061812
struct wireless_dev *ieee80211_ptr;
18071813
struct wpan_dev *ieee802154_ptr;
18081814
#if IS_ENABLED(CONFIG_MPLS_ROUTING)

include/net/ax25.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,12 @@ void ax25_digi_invert(const ax25_digi *, ax25_digi *);
318318
extern ax25_dev *ax25_dev_list;
319319
extern spinlock_t ax25_dev_lock;
320320

321+
#if IS_ENABLED(CONFIG_AX25)
321322
static inline ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
322323
{
323324
return dev->ax25_ptr;
324325
}
326+
#endif
325327

326328
ax25_dev *ax25_addr_ax25dev(ax25_address *);
327329
void ax25_dev_device_up(struct net_device *);

net/core/dev.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8134,8 +8134,9 @@ void netdev_run_todo(void)
81348134
BUG_ON(!list_empty(&dev->ptype_specific));
81358135
WARN_ON(rcu_access_pointer(dev->ip_ptr));
81368136
WARN_ON(rcu_access_pointer(dev->ip6_ptr));
8137+
#if IS_ENABLED(CONFIG_DECNET)
81378138
WARN_ON(dev->dn_ptr);
8138-
8139+
#endif
81398140
if (dev->priv_destructor)
81408141
dev->priv_destructor(dev);
81418142
if (dev->needs_free_netdev)

net/socket.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
#include <linux/ipv6_route.h>
105105
#include <linux/route.h>
106106
#include <linux/sockios.h>
107-
#include <linux/atalk.h>
108107
#include <net/busy_poll.h>
109108
#include <linux/errqueue.h>
110109

0 commit comments

Comments
 (0)