drivers/net/bnx2x: use ARRAY_SIZE macro in bnx2x_main.c
authorNikitas Angelinas <nikitasangelinas@gmail.com>
Wed, 8 Sep 2010 11:20:37 +0000 (11:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Sep 2010 04:56:01 +0000 (21:56 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2x/bnx2x_main.c

index f0a788467fb126fb7e47364126d7eb2be7f913ce..7ba3a6d96fd5e6f1c7ac4477869dac3d97cf8346 100644 (file)
@@ -3830,10 +3830,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);
 }