diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2020-12-01 23:45:00 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-12-03 04:16:29 +0300 |
commit | 65fe1acf07d76198c77a9c9a672928c539bcbc72 (patch) | |
tree | b647a1a6856955165ae967f8cf5325567bd5e901 /drivers/net/dsa/microchip/ksz8795_reg.h | |
parent | 31b62c78c1645e829a08453458224f832ac1ac7b (diff) | |
download | linux-65fe1acf07d76198c77a9c9a672928c539bcbc72.tar.xz |
net: dsa: microchip: ksz8795: use mib_cnt where possible
The variable mib_cnt is assigned with TOTAL_SWITCH_COUNTER_NUM. This
value can also be derived from the array size of mib_names. This patch
uses this calculated value instead, removes the extra define and uses
mib_cnt everywhere possible instead of the static define
TOTAL_SWITCH_COUNTER_NUM. Keeping it in a separate variable instead of
using ARRAY_SIZE everywhere instead makes the driver more flexible for
future use of devices with different amount of counters.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz8795_reg.h')
-rw-r--r-- | drivers/net/dsa/microchip/ksz8795_reg.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/net/dsa/microchip/ksz8795_reg.h b/drivers/net/dsa/microchip/ksz8795_reg.h index 25840719b936..c13122485013 100644 --- a/drivers/net/dsa/microchip/ksz8795_reg.h +++ b/drivers/net/dsa/microchip/ksz8795_reg.h @@ -852,9 +852,6 @@ #define SWITCH_PORT_NUM (TOTAL_PORT_NUM - 1) #define KSZ8795_COUNTER_NUM 0x20 -#define TOTAL_KSZ8795_COUNTER_NUM (KSZ8795_COUNTER_NUM + 4) - -#define TOTAL_SWITCH_COUNTER_NUM TOTAL_KSZ8795_COUNTER_NUM /* Common names used by other drivers */ |