summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorVivien Didelot2017-06-01 22:07:13 +0200
committerDavid S. Miller2017-06-01 23:34:56 +0200
commit717ffbfb28ac2b53d3140b2a7dfd345e1569b3a5 (patch)
tree82020f333943f02ea6e8307c3538ae69817decd0 /include/net/dsa.h
parentnet: dsa: do not cast dst (diff)
downloadkernel-qcow2-linux-717ffbfb28ac2b53d3140b2a7dfd345e1569b3a5.tar.gz
kernel-qcow2-linux-717ffbfb28ac2b53d3140b2a7dfd345e1569b3a5.tar.xz
kernel-qcow2-linux-717ffbfb28ac2b53d3140b2a7dfd345e1569b3a5.zip
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: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 18ca0a935c96..448d8bc77707 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -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);
/* 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)
{
#if IS_ENABLED(CONFIG_NET_DSA)
- if (dev->dsa_ptr != NULL)
- return dsa_uses_tagged_protocol(dev->dsa_ptr);
+ return dev->dsa_ptr && dev->dsa_ptr->rcv;
#endif
return false;
}