From: Tobias Klauser Date: Wed, 23 Apr 2014 17:42:50 +0000 (+0200) Subject: bcm63xx_enet: Use ARRAY_SIZE instead of open coding it X-Git-Tag: firefly_0821_release~176^2~3765^2~325 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6afc0d7a85770abd282ebed41f0f35cde390d861;p=firefly-linux-kernel-4.4.55.git bcm63xx_enet: Use ARRAY_SIZE instead of open coding it Use the ARRAY_SIZE macro to determine the number of entries in bcm_enet_gstrings_stats. Signed-off-by: Tobias Klauser Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index a7d11f5565d6..8db34d389675 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1315,8 +1315,7 @@ static const struct bcm_enet_stats bcm_enet_gstrings_stats[] = { }; -#define BCM_ENET_STATS_LEN \ - (sizeof(bcm_enet_gstrings_stats) / sizeof(struct bcm_enet_stats)) +#define BCM_ENET_STATS_LEN ARRAY_SIZE(bcm_enet_gstrings_stats) static const u32 unused_mib_regs[] = { ETH_MIB_TX_ALL_OCTETS,