Patchwork [5/8] drivers/net/bnx2x: use ARRAY_SIZE macro in bnx2x_main.c

login
register
mail settings
Submitter Nikitas Angelinas
Date Sept. 8, 2010, 9:20 p.m.
Message ID <1283980837-5025-1-git-send-email-nikitasangelinas@gmail.com>
Download mbox | patch
Permalink /patch/64225/
State Accepted
Delegated to: David Miller
Headers show

Comments

Nikitas Angelinas - Sept. 8, 2010, 9:20 p.m.
Replace sizeof(bnx2x_parity_mask)/(sizeof(bnx2x_parity_mask[0]) with
ARRAY_SIZE(bnx2x_parity_mask) in drivers/net/bnx2x/bnx2x_main.c

Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>
---
 drivers/net/bnx2x/bnx2x_main.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
David Miller - Sept. 10, 2010, 4:56 a.m.
From: Nikitas Angelinas <nikitasangelinas@gmail.com>
Date: Wed,  8 Sep 2010 22:20:37 +0100

> Replace sizeof(bnx2x_parity_mask)/(sizeof(bnx2x_parity_mask[0]) with
> ARRAY_SIZE(bnx2x_parity_mask) in drivers/net/bnx2x/bnx2x_main.c
> 
> Signed-off-by: Nikitas Angelinas <nikitasangelinas@gmail.com>

Applied, thank you.
--
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

Patch

diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index f8c3f08..e534ae8 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -3803,10 +3803,9 @@  static const struct {
 
 static void enable_blocks_parity(struct bnx2x *bp)
 {
-	int i, mask_arr_len =
-		sizeof(bnx2x_parity_mask)/(sizeof(bnx2x_parity_mask[0]));
+	int i;
 
-	for (i = 0; i < mask_arr_len; i++)
+	for (i = 0; i < ARRAY_SIZE(bnx2x_parity_mask); i++)
 		REG_WR(bp, bnx2x_parity_mask[i].addr,
 			bnx2x_parity_mask[i].mask);
 }