diff mbox

bcm63xx_enet: Use ARRAY_SIZE instead of open coding it

Message ID 1398274970-8882-1-git-send-email-tklauser@distanz.ch
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Tobias Klauser April 23, 2014, 5:42 p.m. UTC
Use the ARRAY_SIZE macro to determine the number of entries in
bcm_enet_gstrings_stats.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

David Miller April 24, 2014, 5:39 p.m. UTC | #1
From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed, 23 Apr 2014 19:42:50 +0200

> Use the ARRAY_SIZE macro to determine the number of entries in
> bcm_enet_gstrings_stats.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Applied to net-next, thanks Tobias.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index a7d11f5..8db34d3 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,