diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-01-27 15:29:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-29 18:42:46 -0500 |
commit | 26895e299cfb583d304553e9c259e694a7e83397 (patch) | |
tree | 84efe62291aa646b75bb4778db06644e2062fb74 /net/dsa/slave.c | |
parent | a0c02161ecfc2f40a0837926efac5376bc6fd6d3 (diff) |
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/slave.c')
-rw-r--r-- | net/dsa/slave.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 9750dd6f8c17..26b2c070b15a 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -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) |