drivers/net/: all drivers/net/ cleanup with ARRAY_SIZE
Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
committed by
David S. Miller
parent
10d024c1b2
commit
ff8ac60948
@@ -805,7 +805,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
|
||||
i = cs8900_irq_map[0];
|
||||
#else
|
||||
/* Translate the IRQ using the IRQ mapping table. */
|
||||
if (i >= sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0]))
|
||||
if (i >= ARRAY_SIZE(cs8900_irq_map))
|
||||
printk("\ncs89x0: invalid ISA interrupt number %d\n", i);
|
||||
else
|
||||
i = cs8900_irq_map[i];
|
||||
@@ -1246,11 +1246,11 @@ write_irq(struct net_device *dev, int chip_type, int irq)
|
||||
|
||||
if (chip_type == CS8900) {
|
||||
/* Search the mapping table for the corresponding IRQ pin. */
|
||||
for (i = 0; i != sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0]); i++)
|
||||
for (i = 0; i != ARRAY_SIZE(cs8900_irq_map); i++)
|
||||
if (cs8900_irq_map[i] == irq)
|
||||
break;
|
||||
/* Not found */
|
||||
if (i == sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0]))
|
||||
if (i == ARRAY_SIZE(cs8900_irq_map))
|
||||
i = 3;
|
||||
writereg(dev, PP_CS8900_ISAINT, i);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user