Commit 717ffbfb authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: remove dsa_uses_tagged_protocol

Since dev->dsa_ptr is a pointer to a dsa_switch_tree, there is no need
to have another inline helper just to check rcv.

Remove dsa_uses_tagged_protocol and check dsa_ptr && dsa_ptr->rcv
together at the same time.
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 02f840cb
...@@ -468,16 +468,10 @@ struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev); ...@@ -468,16 +468,10 @@ struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
struct net_device *dsa_dev_to_net_device(struct device *dev); struct net_device *dsa_dev_to_net_device(struct device *dev);
/* Keep inline for faster access in hot path */ /* Keep inline for faster access in hot path */
static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
{
return dst->rcv != NULL;
}
static inline bool netdev_uses_dsa(struct net_device *dev) static inline bool netdev_uses_dsa(struct net_device *dev)
{ {
#if IS_ENABLED(CONFIG_NET_DSA) #if IS_ENABLED(CONFIG_NET_DSA)
if (dev->dsa_ptr != NULL) return dev->dsa_ptr && dev->dsa_ptr->rcv;
return dsa_uses_tagged_protocol(dev->dsa_ptr);
#endif #endif
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment