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>
This commit is contained in:

committed by
David S. Miller

parent
a0c02161ec
commit
26895e299c
@@ -404,7 +404,7 @@ static int dsa_fastest_ageing_time(struct dsa_switch *ds,
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < DSA_MAX_PORTS; ++i) {
|
||||
for (i = 0; i < ds->num_ports; ++i) {
|
||||
struct dsa_port *dp = &ds->ports[i];
|
||||
|
||||
if (dp && dp->ageing_time && dp->ageing_time < ageing_time)
|
||||
|
Reference in New Issue
Block a user