net: CONFIG_NET_NS reduction
Use read_pnet() and write_pnet() to reduce number of ifdef CONFIG_NET_NS Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
c6b20d941b
commit
c2d9ba9bce
@@ -1087,11 +1087,7 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
|
||||
static inline
|
||||
struct net *dev_net(const struct net_device *dev)
|
||||
{
|
||||
#ifdef CONFIG_NET_NS
|
||||
return dev->nd_net;
|
||||
#else
|
||||
return &init_net;
|
||||
#endif
|
||||
return read_pnet(&dev->nd_net);
|
||||
}
|
||||
|
||||
static inline
|
||||
|
Reference in New Issue
Block a user