The value of the define VLAN_TABLE_ENTRIES can be derived from num_vlans. This patch is using the variable num_vlans instead and removes the extra define.
Unified · Split
| @@ -1084,7 +1084,7 @@ static int ksz8795_setup(struct dsa_switch *ds) · 1083 unmodified lines | |||
| 1084 | (BROADCAST_STORM_VALUE * | 1084 | (BROADCAST_STORM_VALUE * |
| 1085 | BROADCAST_STORM_PROT_RATE) / 100); | 1085 | BROADCAST_STORM_PROT_RATE) / 100); |
| 1086 | 1086 | ||
| 1087 | for (i = 0; i < VLAN_TABLE_ENTRIES; i++) | 1087 | for (i = 0; i < (dev->num_vlans / 4); i++) |
| 1088 | ksz8795_r_vlan_entries(dev, i); | 1088 | ksz8795_r_vlan_entries(dev, i); |
| 1089 | 1089 | ||
| 1090 | /* Setup STP address for STP operation. */ | 1090 | /* Setup STP address for STP operation. */ |
| @@ -989,7 +989,6 @@ · 988 unmodified lines | |||
| 989 | #define TAIL_TAG_OVERRIDE BIT(6) | 989 | #define TAIL_TAG_OVERRIDE BIT(6) |
| 990 | #define TAIL_TAG_LOOKUP BIT(7) | 990 | #define TAIL_TAG_LOOKUP BIT(7) |
| 991 | 991 | ||
| 992 | #define VLAN_TABLE_ENTRIES (4096 / 4) | ||
| 993 | #define FID_ENTRIES 128 | 992 | #define FID_ENTRIES 128 |
| 994 | 993 | ||
| 995 | #endif | 994 | #endif |