aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDenis Cheng <crquan@gmail.com>2007-09-02 06:30:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:15 -0400
commitff8ac60948ba819b89e9c87083e8050fc2f89999 (patch)
tree611975d22d7ddd8c49a073c61e6e4b7c9523fedb /drivers
parent10d024c1b2fd58af8362670d7d6e5ae52fc33353 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/apne.c2
-rw-r--r--drivers/net/arm/am79c961a.c2
-rw-r--r--drivers/net/atarilance.c2
-rw-r--r--drivers/net/atl1/atl1_hw.c2
-rw-r--r--drivers/net/bnx2.c2
-rw-r--r--drivers/net/cs89x0.c6
-rw-r--r--drivers/net/e1000/e1000_ethtool.c3
-rw-r--r--drivers/net/fec_8xx/fec_mii.c5
-rw-r--r--drivers/net/ibm_emac/ibm_emac_debug.c8
-rw-r--r--drivers/net/irda/actisys-sir.c2
-rw-r--r--drivers/net/ixgb/ixgb_ethtool.c3
-rw-r--r--drivers/net/lp486e.c4
-rw-r--r--drivers/net/mv643xx_eth.c3
-rw-r--r--drivers/net/ne-h8300.c2
-rw-r--r--drivers/net/ne.c2
-rw-r--r--drivers/net/ne2.c2
-rw-r--r--drivers/net/ne2k-pci.c2
-rw-r--r--drivers/net/netxen/netxen_nic.h2
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c2
-rw-r--r--drivers/net/pcmcia/axnet_cs.c2
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c4
-rw-r--r--drivers/net/phy/phy.c2
-rw-r--r--drivers/net/skfp/smt.c2
-rw-r--r--drivers/net/skfp/srf.c4
-rw-r--r--drivers/net/tulip/de4x5.c6
-rw-r--r--drivers/net/wireless/airo.c6
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c6
-rw-r--r--drivers/net/wireless/ipw2100.c7
-rw-r--r--drivers/net/wireless/libertas/main.c14
-rw-r--r--drivers/net/wireless/libertas/wext.c4
-rw-r--r--drivers/net/wireless/netwave_cs.c6
-rw-r--r--drivers/net/wireless/prism54/isl_ioctl.c7
-rw-r--r--drivers/net/wireless/ray_cs.c6
-rw-r--r--drivers/net/wireless/wavelan.c6
-rw-r--r--drivers/net/wireless/wavelan_cs.c6
-rw-r--r--drivers/net/wireless/wl3501_cs.c2
-rw-r--r--drivers/net/zorro8390.c2
37 files changed, 70 insertions, 78 deletions
diff --git a/drivers/net/apne.c b/drivers/net/apne.c
index b073810f9fd8..b5a974a964c2 100644
--- a/drivers/net/apne.c
+++ b/drivers/net/apne.c
@@ -246,7 +246,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
246 {0x00, NE_EN0_RSARHI}, 246 {0x00, NE_EN0_RSARHI},
247 {E8390_RREAD+E8390_START, NE_CMD}, 247 {E8390_RREAD+E8390_START, NE_CMD},
248 }; 248 };
249 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) { 249 for (i = 0; i < ARRAY_SIZE(program_seq); i++) {
250 outb(program_seq[i].value, ioaddr + program_seq[i].offset); 250 outb(program_seq[i].value, ioaddr + program_seq[i].offset);
251 } 251 }
252 252
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 2143eeb7a2b0..77964556776e 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -414,7 +414,7 @@ static void am79c961_setmulticastlist (struct net_device *dev)
414 /* 414 /*
415 * Update the multicast hash table 415 * Update the multicast hash table
416 */ 416 */
417 for (i = 0; i < sizeof(multi_hash) / sizeof(multi_hash[0]); i++) 417 for (i = 0; i < ARRAY_SIZE(multi_hash); i++)
418 write_rreg(dev->base_addr, i + LADRL, multi_hash[i]); 418 write_rreg(dev->base_addr, i + LADRL, multi_hash[i]);
419 419
420 /* 420 /*
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index 97cca505cf90..17b9dbf7bd68 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -263,7 +263,7 @@ struct lance_addr {
263 (highest byte stripped) */ 263 (highest byte stripped) */
264}; 264};
265 265
266#define N_LANCE_ADDR (sizeof(lance_addr_list)/sizeof(*lance_addr_list)) 266#define N_LANCE_ADDR ARRAY_SIZE(lance_addr_list)
267 267
268 268
269/* Definitions for the Lance */ 269/* Definitions for the Lance */
diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c
index ef886bdeac13..9d3bd22e3a82 100644
--- a/drivers/net/atl1/atl1_hw.c
+++ b/drivers/net/atl1/atl1_hw.c
@@ -603,7 +603,7 @@ static struct atl1_spi_flash_dev flash_table[] = {
603 603
604static void atl1_init_flash_opcode(struct atl1_hw *hw) 604static void atl1_init_flash_opcode(struct atl1_hw *hw)
605{ 605{
606 if (hw->flash_vendor >= sizeof(flash_table) / sizeof(flash_table[0])) 606 if (hw->flash_vendor >= ARRAY_SIZE(flash_table))
607 hw->flash_vendor = 0; /* ATMEL */ 607 hw->flash_vendor = 0; /* ATMEL */
608 608
609 /* Init OP table */ 609 /* Init OP table */
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 61debba873ac..f1e7204f78c9 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -3492,7 +3492,7 @@ bnx2_init_nvram(struct bnx2 *bp)
3492 /* Determine the selected interface. */ 3492 /* Determine the selected interface. */
3493 val = REG_RD(bp, BNX2_NVM_CFG1); 3493 val = REG_RD(bp, BNX2_NVM_CFG1);
3494 3494
3495 entry_count = sizeof(flash_table) / sizeof(struct flash_spec); 3495 entry_count = ARRAY_SIZE(flash_table);
3496 3496
3497 if (val & 0x40000000) { 3497 if (val & 0x40000000) {
3498 3498
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 2b4c92193912..4cf82cf5ac10 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -805,7 +805,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
805 i = cs8900_irq_map[0]; 805 i = cs8900_irq_map[0];
806#else 806#else
807 /* Translate the IRQ using the IRQ mapping table. */ 807 /* Translate the IRQ using the IRQ mapping table. */
808 if (i >= sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0])) 808 if (i >= ARRAY_SIZE(cs8900_irq_map))
809 printk("\ncs89x0: invalid ISA interrupt number %d\n", i); 809 printk("\ncs89x0: invalid ISA interrupt number %d\n", i);
810 else 810 else
811 i = cs8900_irq_map[i]; 811 i = cs8900_irq_map[i];
@@ -1246,11 +1246,11 @@ write_irq(struct net_device *dev, int chip_type, int irq)
1246 1246
1247 if (chip_type == CS8900) { 1247 if (chip_type == CS8900) {
1248 /* Search the mapping table for the corresponding IRQ pin. */ 1248 /* Search the mapping table for the corresponding IRQ pin. */
1249 for (i = 0; i != sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0]); i++) 1249 for (i = 0; i != ARRAY_SIZE(cs8900_irq_map); i++)
1250 if (cs8900_irq_map[i] == irq) 1250 if (cs8900_irq_map[i] == irq)
1251 break; 1251 break;
1252 /* Not found */ 1252 /* Not found */
1253 if (i == sizeof(cs8900_irq_map)/sizeof(cs8900_irq_map[0])) 1253 if (i == ARRAY_SIZE(cs8900_irq_map))
1254 i = 3; 1254 i = 3;
1255 writereg(dev, PP_CS8900_ISAINT, i); 1255 writereg(dev, PP_CS8900_ISAINT, i);
1256 } else { 1256 } else {
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 9ecc3adcf6c1..76d16aaf05b6 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -106,8 +106,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
106}; 106};
107 107
108#define E1000_QUEUE_STATS_LEN 0 108#define E1000_QUEUE_STATS_LEN 0
109#define E1000_GLOBAL_STATS_LEN \ 109#define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats)
110 sizeof(e1000_gstrings_stats) / sizeof(struct e1000_stats)
111#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN + E1000_QUEUE_STATS_LEN) 110#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN + E1000_QUEUE_STATS_LEN)
112static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = { 111static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
113 "Register test (offline)", "Eeprom test (offline)", 112 "Register test (offline)", "Eeprom test (offline)",
diff --git a/drivers/net/fec_8xx/fec_mii.c b/drivers/net/fec_8xx/fec_mii.c
index b3fa0d6a159c..e8e10a02d202 100644
--- a/drivers/net/fec_8xx/fec_mii.c
+++ b/drivers/net/fec_8xx/fec_mii.c
@@ -308,12 +308,11 @@ int fec_mii_phy_id_detect(struct net_device *dev)
308 return -1; 308 return -1;
309 } 309 }
310 310
311 for (i = 0, phy = phy_info; i < sizeof(phy_info) / sizeof(phy_info[0]); 311 for (i = 0, phy = phy_info; i < ARRAY_SIZE(phy_info); i++, phy++)
312 i++, phy++)
313 if (phy->id == (phy_hwid >> 4) || phy->id == 0) 312 if (phy->id == (phy_hwid >> 4) || phy->id == 0)
314 break; 313 break;
315 314
316 if (i >= sizeof(phy_info) / sizeof(phy_info[0])) { 315 if (i >= ARRAY_SIZE(phy_info)) {
317 printk(KERN_ERR DRV_MODULE_NAME 316 printk(KERN_ERR DRV_MODULE_NAME
318 ": %s PHY id 0x%08x is not supported!\n", 317 ": %s PHY id 0x%08x is not supported!\n",
319 dev->name, phy_hwid); 318 dev->name, phy_hwid);
diff --git a/drivers/net/ibm_emac/ibm_emac_debug.c b/drivers/net/ibm_emac/ibm_emac_debug.c
index 92f970d402df..1f70906cfb98 100644
--- a/drivers/net/ibm_emac/ibm_emac_debug.c
+++ b/drivers/net/ibm_emac/ibm_emac_debug.c
@@ -132,7 +132,7 @@ void emac_dbg_register(int idx, struct ocp_enet_private *dev)
132{ 132{
133 unsigned long flags; 133 unsigned long flags;
134 134
135 if (idx >= sizeof(__emacs) / sizeof(__emacs[0])) { 135 if (idx >= ARRAY_SIZE(__emacs)) {
136 printk(KERN_WARNING 136 printk(KERN_WARNING
137 "invalid index %d when registering EMAC for debugging\n", 137 "invalid index %d when registering EMAC for debugging\n",
138 idx); 138 idx);
@@ -148,7 +148,7 @@ void mal_dbg_register(int idx, struct ibm_ocp_mal *mal)
148{ 148{
149 unsigned long flags; 149 unsigned long flags;
150 150
151 if (idx >= sizeof(__mals) / sizeof(__mals[0])) { 151 if (idx >= ARRAY_SIZE(__mals)) {
152 printk(KERN_WARNING 152 printk(KERN_WARNING
153 "invalid index %d when registering MAL for debugging\n", 153 "invalid index %d when registering MAL for debugging\n",
154 idx); 154 idx);
@@ -167,11 +167,11 @@ void emac_dbg_dump_all(void)
167 167
168 local_irq_save(flags); 168 local_irq_save(flags);
169 169
170 for (i = 0; i < sizeof(__mals) / sizeof(__mals[0]); ++i) 170 for (i = 0; i < ARRAY_SIZE(__mals); ++i)
171 if (__mals[i]) 171 if (__mals[i])
172 emac_mal_dump(__mals[i]); 172 emac_mal_dump(__mals[i]);
173 173
174 for (i = 0; i < sizeof(__emacs) / sizeof(__emacs[0]); ++i) 174 for (i = 0; i < ARRAY_SIZE(__emacs); ++i)
175 if (__emacs[i]) 175 if (__emacs[i])
176 emac_mac_dump(i, __emacs[i]); 176 emac_mac_dump(i, __emacs[i]);
177 177
diff --git a/drivers/net/irda/actisys-sir.c b/drivers/net/irda/actisys-sir.c
index 9715ab5572e9..ccf6ec548a64 100644
--- a/drivers/net/irda/actisys-sir.c
+++ b/drivers/net/irda/actisys-sir.c
@@ -67,7 +67,7 @@ static int actisys_reset(struct sir_dev *);
67/* Note : the 220L doesn't support 38400, but we will fix that below */ 67/* Note : the 220L doesn't support 38400, but we will fix that below */
68static unsigned baud_rates[] = { 9600, 19200, 57600, 115200, 38400 }; 68static unsigned baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
69 69
70#define MAX_SPEEDS (sizeof(baud_rates)/sizeof(baud_rates[0])) 70#define MAX_SPEEDS ARRAY_SIZE(baud_rates)
71 71
72static struct dongle_driver act220l = { 72static struct dongle_driver act220l = {
73 .owner = THIS_MODULE, 73 .owner = THIS_MODULE,
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 0413cd95eda7..21d35bc53906 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -94,8 +94,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
94 {"tx_csum_offload_errors", IXGB_STAT(hw_csum_tx_error)} 94 {"tx_csum_offload_errors", IXGB_STAT(hw_csum_tx_error)}
95}; 95};
96 96
97#define IXGB_STATS_LEN \ 97#define IXGB_STATS_LEN ARRAY_SIZE(ixgb_gstrings_stats)
98 sizeof(ixgb_gstrings_stats) / sizeof(struct ixgb_stats)
99 98
100static int 99static int
101ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) 100ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c
index 5fc18da1873d..408ae6eb6a8b 100644
--- a/drivers/net/lp486e.c
+++ b/drivers/net/lp486e.c
@@ -515,8 +515,6 @@ CLEAR_INT(void) {
515 outb(0, IOADDR+8); 515 outb(0, IOADDR+8);
516} 516}
517 517
518#define SIZE(x) (sizeof(x)/sizeof((x)[0]))
519
520#if 0 518#if 0
521/* selftest or dump */ 519/* selftest or dump */
522static void 520static void
@@ -532,7 +530,7 @@ i596_port_do(struct net_device *dev, int portcmd, char *cmdname) {
532 mdelay(30); /* random, unmotivated */ 530 mdelay(30); /* random, unmotivated */
533 531
534 printk("lp486e i82596 %s result:\n", cmdname); 532 printk("lp486e i82596 %s result:\n", cmdname);
535 for (m = SIZE(lp->dump.dump); m && lp->dump.dump[m-1] == 0; m--) 533 for (m = ARRAY_SIZE(lp->dump.dump); m && lp->dump.dump[m-1] == 0; m--)
536 ; 534 ;
537 for (i = 0; i < m; i++) { 535 for (i = 0; i < m; i++) {
538 printk(" %04x", lp->dump.dump[i]); 536 printk(" %04x", lp->dump.dump[i]);
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 6317bba9587c..2a808e265a3e 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -2680,8 +2680,7 @@ static const struct mv643xx_stats mv643xx_gstrings_stats[] = {
2680 { "late_collision", MV643XX_STAT(mib_counters.late_collision) }, 2680 { "late_collision", MV643XX_STAT(mib_counters.late_collision) },
2681}; 2681};
2682 2682
2683#define MV643XX_STATS_LEN \ 2683#define MV643XX_STATS_LEN ARRAY_SIZE(mv643xx_gstrings_stats)
2684 sizeof(mv643xx_gstrings_stats) / sizeof(struct mv643xx_stats)
2685 2684
2686static void mv643xx_get_drvinfo(struct net_device *netdev, 2685static void mv643xx_get_drvinfo(struct net_device *netdev,
2687 struct ethtool_drvinfo *drvinfo) 2686 struct ethtool_drvinfo *drvinfo)
diff --git a/drivers/net/ne-h8300.c b/drivers/net/ne-h8300.c
index a0f35361fbec..2b85d1b53344 100644
--- a/drivers/net/ne-h8300.c
+++ b/drivers/net/ne-h8300.c
@@ -257,7 +257,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
257 {E8390_RREAD+E8390_START, E8390_CMD}, 257 {E8390_RREAD+E8390_START, E8390_CMD},
258 }; 258 };
259 259
260 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) 260 for (i = 0; i < ARRAY_SIZE(program_seq); i++)
261 outb_p(program_seq[i].value, ioaddr + program_seq[i].offset); 261 outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
262 262
263 } 263 }
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index c81befc3a7ae..27d87985bb63 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -375,7 +375,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
375 {E8390_RREAD+E8390_START, E8390_CMD}, 375 {E8390_RREAD+E8390_START, E8390_CMD},
376 }; 376 };
377 377
378 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) 378 for (i = 0; i < ARRAY_SIZE(program_seq); i++)
379 outb_p(program_seq[i].value, ioaddr + program_seq[i].offset); 379 outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
380 380
381 } 381 }
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c
index d1a4b8d7122a..f73073b1218a 100644
--- a/drivers/net/ne2.c
+++ b/drivers/net/ne2.c
@@ -430,7 +430,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
430 {E8390_RREAD+E8390_START, E8390_CMD}, 430 {E8390_RREAD+E8390_START, E8390_CMD},
431 }; 431 };
432 432
433 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) 433 for (i = 0; i < ARRAY_SIZE(program_seq); i++)
434 outb_p(program_seq[i].value, base_addr + 434 outb_p(program_seq[i].value, base_addr +
435 program_seq[i].offset); 435 program_seq[i].offset);
436 436
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index 230a0f1e03fb..7ec362b2e3e5 100644
--- a/drivers/net/ne2k-pci.c
+++ b/drivers/net/ne2k-pci.c
@@ -307,7 +307,7 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
307 {0x00, EN0_RSARHI}, 307 {0x00, EN0_RSARHI},
308 {E8390_RREAD+E8390_START, E8390_CMD}, 308 {E8390_RREAD+E8390_START, E8390_CMD},
309 }; 309 };
310 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) 310 for (i = 0; i < ARRAY_SIZE(program_seq); i++)
311 outb(program_seq[i].value, ioaddr + program_seq[i].offset); 311 outb(program_seq[i].value, ioaddr + program_seq[i].offset);
312 312
313 } 313 }
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index aaa34939485b..7bbd5d14175f 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -1119,7 +1119,7 @@ static const struct netxen_brdinfo netxen_boards[] = {
1119 {NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"}, 1119 {NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"},
1120}; 1120};
1121 1121
1122#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(struct netxen_brdinfo)) 1122#define NUM_SUPPORTED_BOARDS ARRAY_SIZE(netxen_boards)
1123 1123
1124static inline void get_brd_port_by_type(u32 type, int *ports) 1124static inline void get_brd_port_by_type(u32 type, int *ports)
1125{ 1125{
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index a7b8d7f23259..2c19b8df98fa 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -569,7 +569,7 @@ int netxen_is_flash_supported(struct netxen_adapter *adapter)
569 /* if the flash size less than 4Mb, make huge war cry and die */ 569 /* if the flash size less than 4Mb, make huge war cry and die */
570 for (j = 1; j < 4; j++) { 570 for (j = 1; j < 4; j++) {
571 addr = j * NETXEN_NIC_WINDOW_MARGIN; 571 addr = j * NETXEN_NIC_WINDOW_MARGIN;
572 for (i = 0; i < (sizeof(locs) / sizeof(locs[0])); i++) { 572 for (i = 0; i < ARRAY_SIZE(locs); i++) {
573 if (netxen_rom_fast_read(adapter, locs[i], &val01) == 0 573 if (netxen_rom_fast_read(adapter, locs[i], &val01) == 0
574 && netxen_rom_fast_read(adapter, (addr + locs[i]), 574 && netxen_rom_fast_read(adapter, (addr + locs[i]),
575 &val02) == 0) { 575 &val02) == 0) {
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index a9db59d2a2f1..28eea206766d 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -232,7 +232,7 @@ static int get_prom(struct pcmcia_device *link)
232 axnet_reset_8390(dev); 232 axnet_reset_8390(dev);
233 mdelay(10); 233 mdelay(10);
234 234
235 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) 235 for (i = 0; i < ARRAY_SIZE(program_seq); i++)
236 outb_p(program_seq[i].value, ioaddr + program_seq[i].offset); 236 outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
237 237
238 for (i = 0; i < 6; i += 2) { 238 for (i = 0; i < 6; i += 2) {
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 49857c1b5067..8ce251cd3209 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -207,7 +207,7 @@ static hw_info_t hw_info[] = {
207 { /* PCMCIA Technology OEM */ 0x01c8, 0x00, 0xa0, 0x0c, 0 } 207 { /* PCMCIA Technology OEM */ 0x01c8, 0x00, 0xa0, 0x0c, 0 }
208}; 208};
209 209
210#define NR_INFO (sizeof(hw_info)/sizeof(hw_info_t)) 210#define NR_INFO ARRAY_SIZE(hw_info)
211 211
212static hw_info_t default_info = { 0, 0, 0, 0, 0 }; 212static hw_info_t default_info = { 0, 0, 0, 0, 0 };
213static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII }; 213static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };
@@ -374,7 +374,7 @@ static hw_info_t *get_prom(struct pcmcia_device *link)
374 pcnet_reset_8390(dev); 374 pcnet_reset_8390(dev);
375 mdelay(10); 375 mdelay(10);
376 376
377 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) 377 for (i = 0; i < ARRAY_SIZE(program_seq); i++)
378 outb_p(program_seq[i].value, ioaddr + program_seq[i].offset); 378 outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
379 379
380 for (i = 0; i < 32; i++) 380 for (i = 0; i < 32; i++)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index cb230f44d6fc..17c1e1555d80 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -204,7 +204,7 @@ static const struct phy_setting settings[] = {
204 }, 204 },
205}; 205};
206 206
207#define MAX_NUM_SETTINGS (sizeof(settings)/sizeof(struct phy_setting)) 207#define MAX_NUM_SETTINGS ARRAY_SIZE(settings)
208 208
209/** 209/**
210 * phy_find_setting - find a PHY settings array entry that matches speed & duplex 210 * phy_find_setting - find a PHY settings array entry that matches speed & duplex
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index 75afc1f07ba0..ced2c8f76be7 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -1654,7 +1654,7 @@ static const struct smt_pdef {
1654 { SMT_P4053, 0, SWAP_SMT_P4053 } , 1654 { SMT_P4053, 0, SWAP_SMT_P4053 } ,
1655} ; 1655} ;
1656 1656
1657#define N_SMT_PLEN (sizeof(smt_pdef)/sizeof(smt_pdef[0])) 1657#define N_SMT_PLEN ARRAY_SIZE(smt_pdef)
1658 1658
1659int smt_check_para(struct s_smc *smc, struct smt_header *sm, 1659int smt_check_para(struct s_smc *smc, struct smt_header *sm,
1660 const u_short list[]) 1660 const u_short list[])
diff --git a/drivers/net/skfp/srf.c b/drivers/net/skfp/srf.c
index 16573aca8b62..6caf713b744c 100644
--- a/drivers/net/skfp/srf.c
+++ b/drivers/net/skfp/srf.c
@@ -43,7 +43,7 @@ static void clear_reported(struct s_smc *smc);
43static void smt_send_srf(struct s_smc *smc); 43static void smt_send_srf(struct s_smc *smc);
44static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index); 44static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index);
45 45
46#define MAX_EVCS (sizeof(smc->evcs)/sizeof(smc->evcs[0])) 46#define MAX_EVCS ARRAY_SIZE(smc->evcs)
47 47
48struct evc_init { 48struct evc_init {
49 u_char code ; 49 u_char code ;
@@ -67,7 +67,7 @@ static const struct evc_init evc_inits[] = {
67 { SMT_EVENT_PORT_PATH_CHANGE, INDEX_PORT,NUMPHYS,SMT_P4053 } , 67 { SMT_EVENT_PORT_PATH_CHANGE, INDEX_PORT,NUMPHYS,SMT_P4053 } ,
68} ; 68} ;
69 69
70#define MAX_INIT_EVC (sizeof(evc_inits)/sizeof(evc_inits[0])) 70#define MAX_INIT_EVC ARRAY_SIZE(evc_inits)
71 71
72void smt_init_evc(struct s_smc *smc) 72void smt_init_evc(struct s_smc *smc)
73{ 73{
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index ba7f47c2dcff..ee4215ca63f0 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -3945,7 +3945,7 @@ create_packet(struct net_device *dev, char *frame, int len)
3945static int 3945static int
3946EISA_signature(char *name, struct device *device) 3946EISA_signature(char *name, struct device *device)
3947{ 3947{
3948 int i, status = 0, siglen = sizeof(de4x5_signatures)/sizeof(c_char *); 3948 int i, status = 0, siglen = ARRAY_SIZE(de4x5_signatures);
3949 struct eisa_device *edev; 3949 struct eisa_device *edev;
3950 3950
3951 *name = '\0'; 3951 *name = '\0';
@@ -3966,7 +3966,7 @@ EISA_signature(char *name, struct device *device)
3966static int 3966static int
3967PCI_signature(char *name, struct de4x5_private *lp) 3967PCI_signature(char *name, struct de4x5_private *lp)
3968{ 3968{
3969 int i, status = 0, siglen = sizeof(de4x5_signatures)/sizeof(c_char *); 3969 int i, status = 0, siglen = ARRAY_SIZE(de4x5_signatures);
3970 3970
3971 if (lp->chipset == DC21040) { 3971 if (lp->chipset == DC21040) {
3972 strcpy(name, "DE434/5"); 3972 strcpy(name, "DE434/5");
@@ -5072,7 +5072,7 @@ mii_get_phy(struct net_device *dev)
5072{ 5072{
5073 struct de4x5_private *lp = netdev_priv(dev); 5073 struct de4x5_private *lp = netdev_priv(dev);
5074 u_long iobase = dev->base_addr; 5074 u_long iobase = dev->base_addr;
5075 int i, j, k, n, limit=sizeof(phy_info)/sizeof(struct phy_table); 5075 int i, j, k, n, limit=ARRAY_SIZE(phy_info);
5076 int id; 5076 int id;
5077 5077
5078 lp->active = 0; 5078 lp->active = 0;
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 80ae75999536..7d717c4d9845 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -7578,9 +7578,9 @@ static const iw_handler airo_private_handler[] =
7578 7578
7579static const struct iw_handler_def airo_handler_def = 7579static const struct iw_handler_def airo_handler_def =
7580{ 7580{
7581 .num_standard = sizeof(airo_handler)/sizeof(iw_handler), 7581 .num_standard = ARRAY_SIZE(airo_handler),
7582 .num_private = sizeof(airo_private_handler)/sizeof(iw_handler), 7582 .num_private = ARRAY_SIZE(airo_private_handler),
7583 .num_private_args = sizeof(airo_private_args)/sizeof(struct iw_priv_args), 7583 .num_private_args = ARRAY_SIZE(airo_private_args),
7584 .standard = airo_handler, 7584 .standard = airo_handler,
7585 .private = airo_private_handler, 7585 .private = airo_private_handler,
7586 .private_args = airo_private_args, 7586 .private_args = airo_private_args,
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index d58ac84f4e9e..730b3541e325 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -3976,9 +3976,9 @@ static const iw_handler prism2_private_handler[] =
3976 3976
3977const struct iw_handler_def hostap_iw_handler_def = 3977const struct iw_handler_def hostap_iw_handler_def =
3978{ 3978{
3979 .num_standard = sizeof(prism2_handler) / sizeof(iw_handler), 3979 .num_standard = ARRAY_SIZE(prism2_handler),
3980 .num_private = sizeof(prism2_private_handler) / sizeof(iw_handler), 3980 .num_private = ARRAY_SIZE(prism2_private_handler),
3981 .num_private_args = sizeof(prism2_priv) / sizeof(struct iw_priv_args), 3981 .num_private_args = ARRAY_SIZE(prism2_priv),
3982 .standard = (iw_handler *) prism2_handler, 3982 .standard = (iw_handler *) prism2_handler,
3983 .private = (iw_handler *) prism2_private_handler, 3983 .private = (iw_handler *) prism2_private_handler,
3984 .private_args = (struct iw_priv_args *) prism2_priv, 3984 .private_args = (struct iw_priv_args *) prism2_priv,
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 12a6887cb9f1..b3c07b93afce 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -8277,10 +8277,9 @@ static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev)
8277 8277
8278static struct iw_handler_def ipw2100_wx_handler_def = { 8278static struct iw_handler_def ipw2100_wx_handler_def = {
8279 .standard = ipw2100_wx_handlers, 8279 .standard = ipw2100_wx_handlers,
8280 .num_standard = sizeof(ipw2100_wx_handlers) / sizeof(iw_handler), 8280 .num_standard = ARRAY_SIZE(ipw2100_wx_handlers),
8281 .num_private = sizeof(ipw2100_private_handler) / sizeof(iw_handler), 8281 .num_private = ARRAY_SIZE(ipw2100_private_handler),
8282 .num_private_args = sizeof(ipw2100_private_args) / 8282 .num_private_args = ARRAY_SIZE(ipw2100_private_args),
8283 sizeof(struct iw_priv_args),
8284 .private = (iw_handler *) ipw2100_private_handler, 8283 .private = (iw_handler *) ipw2100_private_handler,
8285 .private_args = (struct iw_priv_args *)ipw2100_private_args, 8284 .private_args = (struct iw_priv_args *)ipw2100_private_args,
8286 .get_wireless_stats = ipw2100_wx_wireless_stats, 8285 .get_wireless_stats = ipw2100_wx_wireless_stats,
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index cb0359df355e..a54171af7b97 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -123,28 +123,28 @@ struct region_cfp_table {
123static struct region_cfp_table region_cfp_table[] = { 123static struct region_cfp_table region_cfp_table[] = {
124 {0x10, /*US FCC */ 124 {0x10, /*US FCC */
125 channel_freq_power_US_BG, 125 channel_freq_power_US_BG,
126 sizeof(channel_freq_power_US_BG) / sizeof(struct chan_freq_power), 126 ARRAY_SIZE(channel_freq_power_US_BG),
127 } 127 }
128 , 128 ,
129 {0x20, /*CANADA IC */ 129 {0x20, /*CANADA IC */
130 channel_freq_power_US_BG, 130 channel_freq_power_US_BG,
131 sizeof(channel_freq_power_US_BG) / sizeof(struct chan_freq_power), 131 ARRAY_SIZE(channel_freq_power_US_BG),
132 } 132 }
133 , 133 ,
134 {0x30, /*EU*/ channel_freq_power_EU_BG, 134 {0x30, /*EU*/ channel_freq_power_EU_BG,
135 sizeof(channel_freq_power_EU_BG) / sizeof(struct chan_freq_power), 135 ARRAY_SIZE(channel_freq_power_EU_BG),
136 } 136 }
137 , 137 ,
138 {0x31, /*SPAIN*/ channel_freq_power_SPN_BG, 138 {0x31, /*SPAIN*/ channel_freq_power_SPN_BG,
139 sizeof(channel_freq_power_SPN_BG) / sizeof(struct chan_freq_power), 139 ARRAY_SIZE(channel_freq_power_SPN_BG),
140 } 140 }
141 , 141 ,
142 {0x32, /*FRANCE*/ channel_freq_power_FR_BG, 142 {0x32, /*FRANCE*/ channel_freq_power_FR_BG,
143 sizeof(channel_freq_power_FR_BG) / sizeof(struct chan_freq_power), 143 ARRAY_SIZE(channel_freq_power_FR_BG),
144 } 144 }
145 , 145 ,
146 {0x40, /*JAPAN*/ channel_freq_power_JPN_BG, 146 {0x40, /*JAPAN*/ channel_freq_power_JPN_BG,
147 sizeof(channel_freq_power_JPN_BG) / sizeof(struct chan_freq_power), 147 ARRAY_SIZE(channel_freq_power_JPN_BG),
148 } 148 }
149 , 149 ,
150/*Add new region here */ 150/*Add new region here */
@@ -1422,7 +1422,7 @@ struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, int *c
1422 1422
1423 lbs_deb_enter(LBS_DEB_MAIN); 1423 lbs_deb_enter(LBS_DEB_MAIN);
1424 1424
1425 end = sizeof(region_cfp_table)/sizeof(struct region_cfp_table); 1425 end = ARRAY_SIZE(region_cfp_table);
1426 1426
1427 for (i = 0; i < end ; i++) { 1427 for (i = 0; i < end ; i++) {
1428 lbs_deb_main("region_cfp_table[i].region=%d\n", 1428 lbs_deb_main("region_cfp_table[i].region=%d\n",
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 3f628223bc6c..f8036efd7294 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -2149,13 +2149,13 @@ static const iw_handler mesh_wlan_handler[] = {
2149 (iw_handler) NULL, /* SIOCSIWPMKSA */ 2149 (iw_handler) NULL, /* SIOCSIWPMKSA */
2150}; 2150};
2151struct iw_handler_def libertas_handler_def = { 2151struct iw_handler_def libertas_handler_def = {
2152 .num_standard = sizeof(wlan_handler) / sizeof(iw_handler), 2152 .num_standard = ARRAY_SIZE(wlan_handler),
2153 .standard = (iw_handler *) wlan_handler, 2153 .standard = (iw_handler *) wlan_handler,
2154 .get_wireless_stats = wlan_get_wireless_stats, 2154 .get_wireless_stats = wlan_get_wireless_stats,
2155}; 2155};
2156 2156
2157struct iw_handler_def mesh_handler_def = { 2157struct iw_handler_def mesh_handler_def = {
2158 .num_standard = sizeof(mesh_wlan_handler) / sizeof(iw_handler), 2158 .num_standard = ARRAY_SIZE(mesh_wlan_handler),
2159 .standard = (iw_handler *) mesh_wlan_handler, 2159 .standard = (iw_handler *) mesh_wlan_handler,
2160 .get_wireless_stats = wlan_get_wireless_stats, 2160 .get_wireless_stats = wlan_get_wireless_stats,
2161}; 2161};
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index 389fdd313c7e..d8a59afa7178 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -709,9 +709,9 @@ static const iw_handler netwave_private_handler[] =
709 709
710static const struct iw_handler_def netwave_handler_def = 710static const struct iw_handler_def netwave_handler_def =
711{ 711{
712 .num_standard = sizeof(netwave_handler)/sizeof(iw_handler), 712 .num_standard = ARRAY_SIZE(netwave_handler),
713 .num_private = sizeof(netwave_private_handler)/sizeof(iw_handler), 713 .num_private = ARRAY_SIZE(netwave_private_handler),
714 .num_private_args = sizeof(netwave_private_args)/sizeof(struct iw_priv_args), 714 .num_private_args = ARRAY_SIZE(netwave_private_args),
715 .standard = (iw_handler *) netwave_handler, 715 .standard = (iw_handler *) netwave_handler,
716 .private = (iw_handler *) netwave_private_handler, 716 .private = (iw_handler *) netwave_private_handler,
717 .private_args = (struct iw_priv_args *) netwave_private_args, 717 .private_args = (struct iw_priv_args *) netwave_private_args,
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index f1066614dc31..77ea13bf0c02 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -3239,10 +3239,9 @@ static const iw_handler prism54_private_handler[] = {
3239}; 3239};
3240 3240
3241const struct iw_handler_def prism54_handler_def = { 3241const struct iw_handler_def prism54_handler_def = {
3242 .num_standard = sizeof (prism54_handler) / sizeof (iw_handler), 3242 .num_standard = ARRAY_SIZE(prism54_handler),
3243 .num_private = sizeof (prism54_private_handler) / sizeof (iw_handler), 3243 .num_private = ARRAY_SIZE(prism54_private_handler),
3244 .num_private_args = 3244 .num_private_args = ARRAY_SIZE(prism54_private_args),
3245 sizeof (prism54_private_args) / sizeof (struct iw_priv_args),
3246 .standard = (iw_handler *) prism54_handler, 3245 .standard = (iw_handler *) prism54_handler,
3247 .private = (iw_handler *) prism54_private_handler, 3246 .private = (iw_handler *) prism54_private_handler,
3248 .private_args = (struct iw_priv_args *) prism54_private_args, 3247 .private_args = (struct iw_priv_args *) prism54_private_args,
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 1b0e9707049a..429bca8d0b5f 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -1567,9 +1567,9 @@ static const struct iw_priv_args ray_private_args[] = {
1567 1567
1568static const struct iw_handler_def ray_handler_def = 1568static const struct iw_handler_def ray_handler_def =
1569{ 1569{
1570 .num_standard = sizeof(ray_handler)/sizeof(iw_handler), 1570 .num_standard = ARRAY_SIZE(ray_handler),
1571 .num_private = sizeof(ray_private_handler)/sizeof(iw_handler), 1571 .num_private = ARRAY_SIZE(ray_private_handler),
1572 .num_private_args = sizeof(ray_private_args)/sizeof(struct iw_priv_args), 1572 .num_private_args = ARRAY_SIZE(ray_private_args),
1573 .standard = ray_handler, 1573 .standard = ray_handler,
1574 .private = ray_private_handler, 1574 .private = ray_private_handler,
1575 .private_args = ray_private_args, 1575 .private_args = ray_private_args,
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
index b876bf65935b..33ed9fe95f3d 100644
--- a/drivers/net/wireless/wavelan.c
+++ b/drivers/net/wireless/wavelan.c
@@ -2400,9 +2400,9 @@ static const struct iw_priv_args wavelan_private_args[] = {
2400 2400
2401static const struct iw_handler_def wavelan_handler_def = 2401static const struct iw_handler_def wavelan_handler_def =
2402{ 2402{
2403 .num_standard = sizeof(wavelan_handler)/sizeof(iw_handler), 2403 .num_standard = ARRAY_SIZE(wavelan_handler),
2404 .num_private = sizeof(wavelan_private_handler)/sizeof(iw_handler), 2404 .num_private = ARRAY_SIZE(wavelan_private_handler),
2405 .num_private_args = sizeof(wavelan_private_args)/sizeof(struct iw_priv_args), 2405 .num_private_args = ARRAY_SIZE(wavelan_private_args),
2406 .standard = wavelan_handler, 2406 .standard = wavelan_handler,
2407 .private = wavelan_private_handler, 2407 .private = wavelan_private_handler,
2408 .private_args = wavelan_private_args, 2408 .private_args = wavelan_private_args,
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index 1cc5180ab1e7..9b7f44957869 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -2719,9 +2719,9 @@ static const iw_handler wavelan_private_handler[] =
2719 2719
2720static const struct iw_handler_def wavelan_handler_def = 2720static const struct iw_handler_def wavelan_handler_def =
2721{ 2721{
2722 .num_standard = sizeof(wavelan_handler)/sizeof(iw_handler), 2722 .num_standard = ARRAY_SIZE(wavelan_handler),
2723 .num_private = sizeof(wavelan_private_handler)/sizeof(iw_handler), 2723 .num_private = ARRAY_SIZE(wavelan_private_handler),
2724 .num_private_args = sizeof(wavelan_private_args)/sizeof(struct iw_priv_args), 2724 .num_private_args = ARRAY_SIZE(wavelan_private_args),
2725 .standard = wavelan_handler, 2725 .standard = wavelan_handler,
2726 .private = wavelan_private_handler, 2726 .private = wavelan_private_handler,
2727 .private_args = wavelan_private_args, 2727 .private_args = wavelan_private_args,
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index cfde68cff94c..2690f291e3f7 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1893,7 +1893,7 @@ static const iw_handler wl3501_handler[] = {
1893}; 1893};
1894 1894
1895static const struct iw_handler_def wl3501_handler_def = { 1895static const struct iw_handler_def wl3501_handler_def = {
1896 .num_standard = sizeof(wl3501_handler) / sizeof(iw_handler), 1896 .num_standard = ARRAY_SIZE(wl3501_handler),
1897 .standard = (iw_handler *)wl3501_handler, 1897 .standard = (iw_handler *)wl3501_handler,
1898 .get_wireless_stats = wl3501_get_wireless_stats, 1898 .get_wireless_stats = wl3501_get_wireless_stats,
1899}; 1899};
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c
index a45f9952a3f7..fb215eb6dcf3 100644
--- a/drivers/net/zorro8390.c
+++ b/drivers/net/zorro8390.c
@@ -190,7 +190,7 @@ static int __devinit zorro8390_init(struct net_device *dev,
190 {0x00, NE_EN0_RSARHI}, 190 {0x00, NE_EN0_RSARHI},
191 {E8390_RREAD+E8390_START, NE_CMD}, 191 {E8390_RREAD+E8390_START, NE_CMD},
192 }; 192 };
193 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) { 193 for (i = 0; i < ARRAY_SIZE(program_seq); i++) {
194 z_writeb(program_seq[i].value, ioaddr + program_seq[i].offset); 194 z_writeb(program_seq[i].value, ioaddr + program_seq[i].offset);
195 } 195 }
196 } 196 }