aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorAlejandro Martinez Ruiz <alex@flawedcode.org>2007-10-15 03:37:43 +0200
committerJeff Garzik <jeff@garzik.org>2007-10-15 15:57:38 -0400
commite9edda697ed7697f1288d0656570e49c47e204ae (patch)
tree6d43d602b7e0eb98940a516e0e0d2c8fd1a7006a /drivers/net/wan
parent88a15f2e28bd6a908b2925f1b76e70ef3a88297d (diff)
netdev: convert non-obvious instances to use ARRAY_SIZE()
This will convert remaining non-obvious or naive calculations of array sizes to use ARRAY_SIZE() macro. Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/sdla.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index b39a541b250..05df0a345b6 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -1342,11 +1342,11 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map)
if (flp->initialized)
return(-EINVAL);
- for(i=0;i < sizeof(valid_port) / sizeof (int) ; i++)
+ for(i=0; i < ARRAY_SIZE(valid_port); i++)
if (valid_port[i] == map->base_addr)
break;
- if (i == sizeof(valid_port) / sizeof(int))
+ if (i == ARRAY_SIZE(valid_port))
return(-EINVAL);
if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){
@@ -1487,12 +1487,12 @@ got_type:
}
}
- for(i=0;i < sizeof(valid_mem) / sizeof (int) ; i++)
+ for(i=0; i < ARRAY_SIZE(valid_mem); i++)
if (valid_mem[i] == map->mem_start)
break;
err = -EINVAL;
- if (i == sizeof(valid_mem) / sizeof(int))
+ if (i == ARRAY_SIZE(valid_mem))
goto fail2;
if (flp->type == SDLA_S502A && (map->mem_start & 0xF000) >> 12 == 0x0E)