Commit 36fe55d6 authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Jeff Garzik

atm: Use ARRAY_SIZE macro when appropriate

Use ARRAY_SIZE macro already defined in kernel.h for ATM
drivers.
Signed-off-by: default avatarAhmed 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 52edc17f
...@@ -3017,7 +3017,7 @@ read_prom_byte(struct he_dev *he_dev, int addr) ...@@ -3017,7 +3017,7 @@ read_prom_byte(struct he_dev *he_dev, int addr)
he_writel(he_dev, val, HOST_CNTL); he_writel(he_dev, val, HOST_CNTL);
/* Send READ instruction */ /* Send READ instruction */
for (i = 0; i < sizeof(readtab)/sizeof(readtab[0]); i++) { for (i = 0; i < ARRAY_SIZE(readtab); i++) {
he_writel(he_dev, val | readtab[i], HOST_CNTL); he_writel(he_dev, val | readtab[i], HOST_CNTL);
udelay(EEPROM_DELAY); udelay(EEPROM_DELAY);
} }
......
...@@ -388,7 +388,7 @@ idt77252_eeprom_read_status(struct idt77252_dev *card) ...@@ -388,7 +388,7 @@ idt77252_eeprom_read_status(struct idt77252_dev *card)
gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO); gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
for (i = 0; i < sizeof(rdsrtab)/sizeof(rdsrtab[0]); i++) { for (i = 0; i < ARRAY_SIZE(rdsrtab); i++) {
idt77252_write_gp(card, gp | rdsrtab[i]); idt77252_write_gp(card, gp | rdsrtab[i]);
udelay(5); udelay(5);
} }
...@@ -422,7 +422,7 @@ idt77252_eeprom_read_byte(struct idt77252_dev *card, u8 offset) ...@@ -422,7 +422,7 @@ idt77252_eeprom_read_byte(struct idt77252_dev *card, u8 offset)
gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO); gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
for (i = 0; i < sizeof(rdtab)/sizeof(rdtab[0]); i++) { for (i = 0; i < ARRAY_SIZE(rdtab); i++) {
idt77252_write_gp(card, gp | rdtab[i]); idt77252_write_gp(card, gp | rdtab[i]);
udelay(5); udelay(5);
} }
...@@ -469,14 +469,14 @@ idt77252_eeprom_write_byte(struct idt77252_dev *card, u8 offset, u8 data) ...@@ -469,14 +469,14 @@ idt77252_eeprom_write_byte(struct idt77252_dev *card, u8 offset, u8 data)
gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO); gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK|SAR_GP_EECS|SAR_GP_EEDO);
for (i = 0; i < sizeof(wrentab)/sizeof(wrentab[0]); i++) { for (i = 0; i < ARRAY_SIZE(wrentab); i++) {
idt77252_write_gp(card, gp | wrentab[i]); idt77252_write_gp(card, gp | wrentab[i]);
udelay(5); udelay(5);
} }
idt77252_write_gp(card, gp | SAR_GP_EECS); idt77252_write_gp(card, gp | SAR_GP_EECS);
udelay(5); udelay(5);
for (i = 0; i < sizeof(wrtab)/sizeof(wrtab[0]); i++) { for (i = 0; i < ARRAY_SIZE(wrtab); i++) {
idt77252_write_gp(card, gp | wrtab[i]); idt77252_write_gp(card, gp | wrtab[i]);
udelay(5); udelay(5);
} }
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Read this ForeRunner's MAC address from eprom/eeprom * Read this ForeRunner's MAC address from eprom/eeprom
*/ */
#include <linux/kernel.h>
typedef void __iomem *virt_addr_t; typedef void __iomem *virt_addr_t;
#define CYCLE_DELAY 5 #define CYCLE_DELAY 5
...@@ -176,7 +178,7 @@ read_eprom_byte(virt_addr_t base, u_int8_t offset) ...@@ -176,7 +178,7 @@ read_eprom_byte(virt_addr_t base, u_int8_t offset)
val = NICSTAR_REG_READ( base, NICSTAR_REG_GENERAL_PURPOSE ) & 0xFFFFFFF0; val = NICSTAR_REG_READ( base, NICSTAR_REG_GENERAL_PURPOSE ) & 0xFFFFFFF0;
/* Send READ instruction */ /* Send READ instruction */
for (i=0; i<sizeof readtab/sizeof readtab[0]; i++) for (i=0; i<ARRAY_SIZE(readtab); i++)
{ {
NICSTAR_REG_WRITE( base, NICSTAR_REG_GENERAL_PURPOSE, NICSTAR_REG_WRITE( base, NICSTAR_REG_GENERAL_PURPOSE,
(val | readtab[i]) ); (val | readtab[i]) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment