Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff8ac609 authored by Denis Cheng's avatar Denis Cheng Committed by David S. Miller
Browse files

drivers/net/: all drivers/net/ cleanup with ARRAY_SIZE



Signed-off-by: default avatarDenis Cheng <crquan@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 10d024c1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -246,7 +246,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
	    {0x00,	NE_EN0_RSARHI},
	    {0x00,	NE_EN0_RSARHI},
	    {E8390_RREAD+E8390_START, NE_CMD},
	    {E8390_RREAD+E8390_START, NE_CMD},
	};
	};
	for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) {
	for (i = 0; i < ARRAY_SIZE(program_seq); i++) {
	    outb(program_seq[i].value, ioaddr + program_seq[i].offset);
	    outb(program_seq[i].value, ioaddr + program_seq[i].offset);
	}
	}


+1 −1
Original line number Original line Diff line number Diff line
@@ -414,7 +414,7 @@ static void am79c961_setmulticastlist (struct net_device *dev)
	/*
	/*
	 * Update the multicast hash table
	 * Update the multicast hash table
	 */
	 */
	for (i = 0; i < sizeof(multi_hash) / sizeof(multi_hash[0]); i++)
	for (i = 0; i < ARRAY_SIZE(multi_hash); i++)
		write_rreg(dev->base_addr, i + LADRL, multi_hash[i]);
		write_rreg(dev->base_addr, i + LADRL, multi_hash[i]);


	/*
	/*
+1 −1
Original line number Original line Diff line number Diff line
@@ -263,7 +263,7 @@ struct lance_addr {
									   (highest byte stripped) */
									   (highest byte stripped) */
};
};


#define	N_LANCE_ADDR	(sizeof(lance_addr_list)/sizeof(*lance_addr_list))
#define	N_LANCE_ADDR	ARRAY_SIZE(lance_addr_list)




/* Definitions for the Lance */
/* Definitions for the Lance */
+1 −1
Original line number Original line Diff line number Diff line
@@ -603,7 +603,7 @@ static struct atl1_spi_flash_dev flash_table[] = {


static void atl1_init_flash_opcode(struct atl1_hw *hw)
static void atl1_init_flash_opcode(struct atl1_hw *hw)
{
{
	if (hw->flash_vendor >= sizeof(flash_table) / sizeof(flash_table[0]))
	if (hw->flash_vendor >= ARRAY_SIZE(flash_table))
		hw->flash_vendor = 0;	/* ATMEL */
		hw->flash_vendor = 0;	/* ATMEL */


	/* Init OP table */
	/* Init OP table */
+1 −1
Original line number Original line Diff line number Diff line
@@ -3492,7 +3492,7 @@ bnx2_init_nvram(struct bnx2 *bp)
	/* Determine the selected interface. */
	/* Determine the selected interface. */
	val = REG_RD(bp, BNX2_NVM_CFG1);
	val = REG_RD(bp, BNX2_NVM_CFG1);


	entry_count = sizeof(flash_table) / sizeof(struct flash_spec);
	entry_count = ARRAY_SIZE(flash_table);


	if (val & 0x40000000) {
	if (val & 0x40000000) {


Loading