aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwish.07@gmail.com>2007-02-16 04:42:23 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-17 15:30:48 -0500
commit36fe55d6a3c7096a7dc852010865c63d572aeaf4 (patch)
tree5fbd732b547c94f930ec9347c530b74b066b35c9 /drivers/atm
parent52edc17f94f7bd4d9a66bb13d9142f4072c7a82d (diff)
atm: Use ARRAY_SIZE macro when appropriate
Use ARRAY_SIZE macro already defined in kernel.h for ATM drivers. Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: chas williams <chas@cmf.nrl.navy.mil> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/he.c2
-rw-r--r--drivers/atm/idt77252.c8
-rw-r--r--drivers/atm/nicstarmac.c4
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index db33f6f4dd2a..8510026b690a 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -3017,7 +3017,7 @@ read_prom_byte(struct he_dev *he_dev, int addr)
3017 he_writel(he_dev, val, HOST_CNTL); 3017 he_writel(he_dev, val, HOST_CNTL);
3018 3018
3019 /* Send READ instruction */ 3019 /* Send READ instruction */
3020 for (i = 0; i < sizeof(readtab)/sizeof(readtab[0]); i++) { 3020 for (i = 0; i < ARRAY_SIZE(readtab); i++) {
3021 he_writel(he_dev, val | readtab[i], HOST_CNTL); 3021 he_writel(he_dev, val | readtab[i], HOST_CNTL);
3022 udelay(EEPROM_DELAY); 3022 udelay(EEPROM_DELAY);
3023 } 3023 }
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index f40786121948..b4b80140c398 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -388,7 +388,7 @@ idt77252_eeprom_read_status(struct idt77252_dev *card)
388 388
389 gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO); 389 gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
390 390
391 for (i = 0; i < sizeof(rdsrtab)/sizeof(rdsrtab[0]); i++) { 391 for (i = 0; i < ARRAY_SIZE(rdsrtab); i++) {
392 idt77252_write_gp(card, gp | rdsrtab[i]); 392 idt77252_write_gp(card, gp | rdsrtab[i]);
393 udelay(5); 393 udelay(5);
394 } 394 }
@@ -422,7 +422,7 @@ idt77252_eeprom_read_byte(struct idt77252_dev *card, u8 offset)
422 422
423 gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO); 423 gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
424 424
425 for (i = 0; i < sizeof(rdtab)/sizeof(rdtab[0]); i++) { 425 for (i = 0; i < ARRAY_SIZE(rdtab); i++) {
426 idt77252_write_gp(card, gp | rdtab[i]); 426 idt77252_write_gp(card, gp | rdtab[i]);
427 udelay(5); 427 udelay(5);
428 } 428 }
@@ -469,14 +469,14 @@ idt77252_eeprom_write_byte(struct idt77252_dev *card, u8 offset, u8 data)
469 469
470 gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO); 470 gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
471 471
472 for (i = 0; i < sizeof(wrentab)/sizeof(wrentab[0]); i++) { 472 for (i = 0; i < ARRAY_SIZE(wrentab); i++) {
473 idt77252_write_gp(card, gp | wrentab[i]); 473 idt77252_write_gp(card, gp | wrentab[i]);
474 udelay(5); 474 udelay(5);
475 } 475 }
476 idt77252_write_gp(card, gp | SAR_GP_EECS); 476 idt77252_write_gp(card, gp | SAR_GP_EECS);
477 udelay(5); 477 udelay(5);
478 478
479 for (i = 0; i < sizeof(wrtab)/sizeof(wrtab[0]); i++) { 479 for (i = 0; i < ARRAY_SIZE(wrtab); i++) {
480 idt77252_write_gp(card, gp | wrtab[i]); 480 idt77252_write_gp(card, gp | wrtab[i]);
481 udelay(5); 481 udelay(5);
482 } 482 }
diff --git a/drivers/atm/nicstarmac.c b/drivers/atm/nicstarmac.c
index 2c5e3ae77503..480947f4e01e 100644
--- a/drivers/atm/nicstarmac.c
+++ b/drivers/atm/nicstarmac.c
@@ -7,6 +7,8 @@
7 * Read this ForeRunner's MAC address from eprom/eeprom 7 * Read this ForeRunner's MAC address from eprom/eeprom
8 */ 8 */
9 9
10#include <linux/kernel.h>
11
10typedef void __iomem *virt_addr_t; 12typedef void __iomem *virt_addr_t;
11 13
12#define CYCLE_DELAY 5 14#define CYCLE_DELAY 5
@@ -176,7 +178,7 @@ read_eprom_byte(virt_addr_t base, u_int8_t offset)
176 val = NICSTAR_REG_READ( base, NICSTAR_REG_GENERAL_PURPOSE ) & 0xFFFFFFF0; 178 val = NICSTAR_REG_READ( base, NICSTAR_REG_GENERAL_PURPOSE ) & 0xFFFFFFF0;
177 179
178 /* Send READ instruction */ 180 /* Send READ instruction */
179 for (i=0; i<sizeof readtab/sizeof readtab[0]; i++) 181 for (i=0; i<ARRAY_SIZE(readtab); i++)
180 { 182 {
181 NICSTAR_REG_WRITE( base, NICSTAR_REG_GENERAL_PURPOSE, 183 NICSTAR_REG_WRITE( base, NICSTAR_REG_GENERAL_PURPOSE,
182 (val | readtab[i]) ); 184 (val | readtab[i]) );