mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
net: dsa: mt7530: convert to use field accessor macros
Use FIELD_GET and FIELD_PREP instead of open-coding register fields. Replace 0x1f constant with (PHY_MAX_ADDR - 1). Some field macros (ATC_HASH, VTCR_VID and STAG_VPID) were previously defined as object-like macros referencing an undeclared 'x' and were therefore unusable; convert them into proper FIELD_PREP() accessors. The masks are equivalent to the open-coded values they replace, with one exception: mt7530_vlan_cmd() now masks vid through VTCR_VID(vid) instead of OR-ing it in raw, guarding the adjacent VTCR_FUNC field against any bits set above the 12-bit VID width. VLAN IDs are always in 0-4094, so this is a no-op in practice; it is a real hardening rather than a strictly equivalent mechanical substitution. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/bd4eaf10fb6aa7a1bd056514b61b4481175708a5.1788190568.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
d7110c1dab
commit
3d8ca6f904
2 changed files with 148 additions and 124 deletions
Loading…
Add table
Add a link
Reference in a new issue