diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-12-06 18:57:49 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-12-08 14:31:14 -0800 |
commit | 872bb81dfbc3811bc77aafd63deca73a08a9c20f (patch) | |
tree | b54887840e55209905ac8c6350f1502ce5134a5b /net/dsa/switch.c | |
parent | 947c8746e2c31bb469ba9ee02dc739be6a98ee38 (diff) | |
download | linux-872bb81dfbc3811bc77aafd63deca73a08a9c20f.tar.gz linux-872bb81dfbc3811bc77aafd63deca73a08a9c20f.tar.bz2 linux-872bb81dfbc3811bc77aafd63deca73a08a9c20f.zip |
net: dsa: mt7530: iterate using dsa_switch_for_each_user_port in bridging ops
Avoid repeated calls to dsa_to_port() (some hidden behind dsa_is_user_port
and some in plain sight) by keeping two struct dsa_port references: one
to the port passed as argument, and another to the other ports of the
switch that we're iterating over.
dsa_to_port(ds, i) gets replaced by other_dp, i gets replaced by
other_port which is derived from other_dp->index, dsa_is_user_port is
handled by the DSA iterator.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa/switch.c')
0 files changed, 0 insertions, 0 deletions