Skip to content

Commit 8f5c71e

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: lantiq_gswip: remove duplicate assignment to vlan_mapping.val[0]
When idx == -1 in gswip_vlan_add(), we set vlan_mapping.val[0] = vid, even though we do the exact same thing again outside the if/else block. Remove the duplicate assignment. Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: Daniel Golle <[email protected]> Link: https://patch.msgid.link/039ecb48e038cea856a9a6230ad1543db2bc382d.1760566491.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 92790e6 commit 8f5c71e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/dsa/lantiq/lantiq_gswip.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,6 @@ static int gswip_vlan_add_aware(struct gswip_priv *priv,
848848

849849
vlan_mapping.index = idx;
850850
vlan_mapping.table = GSWIP_TABLE_VLAN_MAPPING;
851-
/* VLAN ID byte, maps to the VLAN ID of vlan active table */
852-
vlan_mapping.val[0] = vid;
853851
} else {
854852
/* Read the existing VLAN mapping entry from the switch */
855853
vlan_mapping.index = idx;
@@ -862,6 +860,7 @@ static int gswip_vlan_add_aware(struct gswip_priv *priv,
862860
}
863861
}
864862

863+
/* VLAN ID byte, maps to the VLAN ID of vlan active table */
865864
vlan_mapping.val[0] = vid;
866865
/* Update the VLAN mapping entry and write it to the switch */
867866
vlan_mapping.val[1] |= cpu_ports;

0 commit comments

Comments
 (0)