summaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_brcm.c
diff options
context:
space:
mode:
authorVivien Didelot2017-01-27 21:29:37 +0100
committerDavid S. Miller2017-01-30 00:42:46 +0100
commit26895e299cfb583d304553e9c259e694a7e83397 (patch)
tree84efe62291aa646b75bb4778db06644e2062fb74 /net/dsa/tag_brcm.c
parentnet: dsa: variable number of ports (diff)
downloadkernel-qcow2-linux-26895e299cfb583d304553e9c259e694a7e83397.tar.gz
kernel-qcow2-linux-26895e299cfb583d304553e9c259e694a7e83397.tar.xz
kernel-qcow2-linux-26895e299cfb583d304553e9c259e694a7e83397.zip
net: dsa: use ds->num_ports when possible
The dsa_switch structure contains the number of ports. Use it where the structure is valid instead of the DSA_MAX_PORTS value. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_brcm.c')
-rw-r--r--net/dsa/tag_brcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c
index cb5a2b7a0118..93e4458c02f9 100644
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -128,7 +128,7 @@ static int brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
source_port = brcm_tag[3] & BRCM_EG_PID_MASK;
/* Validate port against switch setup, either the port is totally */
- if (source_port >= DSA_MAX_PORTS || !ds->ports[source_port].netdev)
+ if (source_port >= ds->num_ports || !ds->ports[source_port].netdev)
goto out_drop;
/* Remove Broadcom tag and update checksum */