1 From 61e9b19f6e6174afa7540f0b468a69bc940b91d4 Mon Sep 17 00:00:00 2001
2 From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
3 Date: Mon, 1 Aug 2022 21:23:49 +0200
4 Subject: [PATCH 738/768] net: dsa: lantiq_gswip: Consistently use macros for
7 Introduce a new GSWIP_TABLE_MAC_BRIDGE_PORT macro and use it throughout
8 the driver. Also update GSWIP_TABLE_MAC_BRIDGE_STATIC to use the BIT()
9 macro. This makes the driver code easier to understand.
11 Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
13 drivers/net/dsa/lantiq_gswip.c | 9 ++++++---
14 1 file changed, 6 insertions(+), 3 deletions(-)
16 --- a/drivers/net/dsa/lantiq_gswip.c
17 +++ b/drivers/net/dsa/lantiq_gswip.c
19 #define GSWIP_TABLE_ACTIVE_VLAN 0x01
20 #define GSWIP_TABLE_VLAN_MAPPING 0x02
21 #define GSWIP_TABLE_MAC_BRIDGE 0x0b
22 -#define GSWIP_TABLE_MAC_BRIDGE_STATIC 0x01 /* Static not, aging entry */
23 +#define GSWIP_TABLE_MAC_BRIDGE_STATIC BIT(0) /* Static not, aging entry */
24 +#define GSWIP_TABLE_MAC_BRIDGE_PORT GENMASK(7, 4) /* Port on learned entries */
26 #define XRX200_GPHY_FW_ALIGN (16 * 1024)
28 @@ -1300,7 +1301,8 @@ static void gswip_port_fast_age(struct d
29 if (mac_bridge.val[1] & GSWIP_TABLE_MAC_BRIDGE_STATIC)
32 - if (((mac_bridge.val[0] & GENMASK(7, 4)) >> 4) != port)
33 + if (port != FIELD_GET(GSWIP_TABLE_MAC_BRIDGE_PORT,
37 mac_bridge.valid = false;
38 @@ -1438,7 +1440,8 @@ static int gswip_port_fdb_dump(struct ds
42 - if (((mac_bridge.val[0] & GENMASK(7, 4)) >> 4) == port) {
43 + if (port == FIELD_GET(GSWIP_TABLE_MAC_BRIDGE_PORT,
44 + mac_bridge.val[0])) {
45 err = cb(addr, 0, false, data);