diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-05-24 15:14:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-24 22:59:03 +0200 |
commit | 82760d7f2ea63829d6ab0f3de7ec98b93132c8ee (patch) | |
tree | d4d0f0b1bd7367a2cb804c98344b5081b029ba46 /drivers/net/dsa/sja1105/sja1105_flower.c | |
parent | net: dsa: sja1105: avoid some work for unused ports (diff) | |
download | linux-82760d7f2ea63829d6ab0f3de7ec98b93132c8ee.tar.xz linux-82760d7f2ea63829d6ab0f3de7ec98b93132c8ee.zip |
net: dsa: sja1105: dimension the data structures for a larger port count
Introduce a SJA1105_MAX_NUM_PORTS macro which at the moment is equal to
SJA1105_NUM_PORTS (5). With the introduction of SJA1110, these
structures will need to hold information for up to 11 ports.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/sja1105/sja1105_flower.c')
-rw-r--r-- | drivers/net/dsa/sja1105/sja1105_flower.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_flower.c b/drivers/net/dsa/sja1105/sja1105_flower.c index 77c54126b3fc..6c10ffa968ce 100644 --- a/drivers/net/dsa/sja1105/sja1105_flower.c +++ b/drivers/net/dsa/sja1105/sja1105_flower.c @@ -72,7 +72,7 @@ static int sja1105_setup_bcast_policer(struct sja1105_private *priv, /* Make the broadcast policers of all ports attached to this block * point to the newly allocated policer */ - for_each_set_bit(p, &rule->port_mask, SJA1105_NUM_PORTS) { + for_each_set_bit(p, &rule->port_mask, SJA1105_MAX_NUM_PORTS) { int bcast = (ds->num_ports * SJA1105_NUM_TC) + p; policing[bcast].sharindx = rule->bcast_pol.sharindx; @@ -144,7 +144,7 @@ static int sja1105_setup_tc_policer(struct sja1105_private *priv, /* Make the policers for traffic class @tc of all ports attached to * this block point to the newly allocated policer */ - for_each_set_bit(p, &rule->port_mask, SJA1105_NUM_PORTS) { + for_each_set_bit(p, &rule->port_mask, SJA1105_MAX_NUM_PORTS) { int index = (p * SJA1105_NUM_TC) + tc; policing[index].sharindx = rule->tc_pol.sharindx; |