Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: tag_rzn1_a5psw: use the dsa_xmit_port_mask() helper

The "a5psw" tagging protocol populates a bit mask for the TX ports,
so we can use dsa_xmit_port_mask() to centralize the decision of how to
set that field.

Cc: "Clément Léger" <clement.leger@bootlin.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251127120902.292555-13-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Vladimir Oltean and committed by
Jakub Kicinski
b33aa90e 5afe4ccc

+1 -2
+1 -2
net/dsa/tag_rzn1_a5psw.c
··· 39 39 40 40 static struct sk_buff *a5psw_tag_xmit(struct sk_buff *skb, struct net_device *dev) 41 41 { 42 - struct dsa_port *dp = dsa_user_to_port(dev); 43 42 struct a5psw_tag *ptag; 44 43 u32 data2_val; 45 44 ··· 59 60 60 61 ptag = dsa_etype_header_pos_tx(skb); 61 62 62 - data2_val = FIELD_PREP(A5PSW_CTRL_DATA_PORT, BIT(dp->index)); 63 + data2_val = FIELD_PREP(A5PSW_CTRL_DATA_PORT, dsa_xmit_port_mask(skb, dev)); 63 64 ptag->ctrl_tag = htons(ETH_P_DSA_A5PSW); 64 65 ptag->ctrl_data = htons(A5PSW_CTRL_DATA_FORCE_FORWARD); 65 66 ptag->ctrl_data2_lo = htons(data2_val);