From 3cc9f2573cdcbc6991aa2d1c8e04a4b9190487f8 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Tue, 13 Jun 2017 13:27:22 -0700 Subject: net: dsa: Introduce dsa_get_cpu_port() Introduce a helper function which will return a reference to the CPU port used in a dsa_switch_tree. Right now this is a singleton, but this will change once we introduce multi-CPU port support, so ease the transition by converting the affected code paths. Reviewed-by: Vivien Didelot Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller --- net/dsa/tag_ksz.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'net/dsa/tag_ksz.c') diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index b94a334a1d02..fab41de8e983 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -75,12 +75,11 @@ static struct sk_buff *ksz_rcv(struct sk_buff *skb, struct net_device *dev, struct net_device *orig_dev) { struct dsa_switch_tree *dst = dev->dsa_ptr; - struct dsa_switch *ds; + struct dsa_port *cpu_dp = dsa_get_cpu_port(dst); + struct dsa_switch *ds = cpu_dp->ds; u8 *tag; int source_port; - ds = dst->cpu_dp->ds; - tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN; source_port = tag[0] & 7; -- cgit v1.2.3