Skip to content

Commit

Permalink
net: dsa: remove gratuitous use of dsa_is_{user,dsa,cpu}_port
Browse files Browse the repository at this point in the history
Find the occurrences of dsa_is_{user,dsa,cpu}_port where a struct
dsa_port *dp was already available in the function scope, and replace
them with the dsa_port_is_{user,dsa,cpu} equivalent function which uses
that dp directly and does not perform another hidden dsa_to_port().

Signed-off-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vladimiroltean authored and davem330 committed Oct 21, 2021
1 parent 65c563a commit 57d7798
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/dsa/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static bool dsa_port_can_apply_vlan_filtering(struct dsa_port *dp,
* enter an inconsistent state: deny changing the VLAN awareness state
* as long as we have 8021q uppers.
*/
if (vlan_filtering && dsa_is_user_port(ds, dp->index)) {
if (vlan_filtering && dsa_port_is_user(dp)) {
struct net_device *upper_dev, *slave = dp->slave;
struct net_device *br = dp->bridge_dev;
struct list_head *iter;
Expand Down Expand Up @@ -1038,7 +1038,7 @@ static void dsa_port_phylink_mac_link_down(struct phylink_config *config,
struct phy_device *phydev = NULL;
struct dsa_switch *ds = dp->ds;

if (dsa_is_user_port(ds, dp->index))
if (dsa_port_is_user(dp))
phydev = dp->slave->phydev;

if (!ds->ops->phylink_mac_link_down) {
Expand Down

0 comments on commit 57d7798

Please sign in to comment.