diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-10-08 00:14:29 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:11:57 -0500 |
commit | b4341135794fdad85f995a378da424e4f4128e4d (patch) | |
tree | d990a52885f7a87ad0e121e981c112ac41193fb1 /drivers/net | |
parent | 00a5ebf8621e8098305ca5e7b319937eed430184 (diff) |
[PATCH] atmel: use ARRAY_SIZE()
NET: atmel - switch to using ARRAY_SIZE()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/atmel.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 3a6397ffda50..c253e9aad104 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -1193,7 +1193,7 @@ static irqreturn_t service_interrupt(int irq, void *dev_id) | |||
1193 | 1193 | ||
1194 | atmel_set_gcr(dev, GCR_ACKINT); /* acknowledge interrupt */ | 1194 | atmel_set_gcr(dev, GCR_ACKINT); /* acknowledge interrupt */ |
1195 | 1195 | ||
1196 | for (i = 0; i < sizeof(irq_order)/sizeof(u8); i++) | 1196 | for (i = 0; i < ARRAY_SIZE(irq_order); i++) |
1197 | if (isr & irq_order[i]) | 1197 | if (isr & irq_order[i]) |
1198 | break; | 1198 | break; |
1199 | 1199 | ||
@@ -1345,10 +1345,10 @@ int atmel_open(struct net_device *dev) | |||
1345 | atmel_set_mib8(priv, Phy_Mib_Type, PHY_MIB_REG_DOMAIN_POS, priv->reg_domain); | 1345 | atmel_set_mib8(priv, Phy_Mib_Type, PHY_MIB_REG_DOMAIN_POS, priv->reg_domain); |
1346 | } else { | 1346 | } else { |
1347 | priv->reg_domain = atmel_get_mib8(priv, Phy_Mib_Type, PHY_MIB_REG_DOMAIN_POS); | 1347 | priv->reg_domain = atmel_get_mib8(priv, Phy_Mib_Type, PHY_MIB_REG_DOMAIN_POS); |
1348 | for (i = 0; i < sizeof(channel_table)/sizeof(channel_table[0]); i++) | 1348 | for (i = 0; i < ARRAY_SIZE(channel_table); i++) |
1349 | if (priv->reg_domain == channel_table[i].reg_domain) | 1349 | if (priv->reg_domain == channel_table[i].reg_domain) |
1350 | break; | 1350 | break; |
1351 | if (i == sizeof(channel_table)/sizeof(channel_table[0])) { | 1351 | if (i == ARRAY_SIZE(channel_table)) { |
1352 | priv->reg_domain = REG_DOMAIN_MKK1; | 1352 | priv->reg_domain = REG_DOMAIN_MKK1; |
1353 | printk(KERN_ALERT "%s: failed to get regulatory domain: assuming MKK1.\n", dev->name); | 1353 | printk(KERN_ALERT "%s: failed to get regulatory domain: assuming MKK1.\n", dev->name); |
1354 | } | 1354 | } |
@@ -1393,7 +1393,7 @@ static int atmel_validate_channel(struct atmel_private *priv, int channel) | |||
1393 | else return suitable default channel */ | 1393 | else return suitable default channel */ |
1394 | int i; | 1394 | int i; |
1395 | 1395 | ||
1396 | for (i = 0; i < sizeof(channel_table)/sizeof(channel_table[0]); i++) | 1396 | for (i = 0; i < ARRAY_SIZE(channel_table); i++) |
1397 | if (priv->reg_domain == channel_table[i].reg_domain) { | 1397 | if (priv->reg_domain == channel_table[i].reg_domain) { |
1398 | if (channel >= channel_table[i].min && | 1398 | if (channel >= channel_table[i].min && |
1399 | channel <= channel_table[i].max) | 1399 | channel <= channel_table[i].max) |
@@ -1437,7 +1437,7 @@ static int atmel_proc_output (char *buf, struct atmel_private *priv) | |||
1437 | } | 1437 | } |
1438 | 1438 | ||
1439 | r = "<unknown>"; | 1439 | r = "<unknown>"; |
1440 | for (i = 0; i < sizeof(channel_table)/sizeof(channel_table[0]); i++) | 1440 | for (i = 0; i < ARRAY_SIZE(channel_table); i++) |
1441 | if (priv->reg_domain == channel_table[i].reg_domain) | 1441 | if (priv->reg_domain == channel_table[i].reg_domain) |
1442 | r = channel_table[i].name; | 1442 | r = channel_table[i].name; |
1443 | 1443 | ||
@@ -2373,7 +2373,7 @@ static int atmel_get_range(struct net_device *dev, | |||
2373 | range->min_nwid = 0x0000; | 2373 | range->min_nwid = 0x0000; |
2374 | range->max_nwid = 0x0000; | 2374 | range->max_nwid = 0x0000; |
2375 | range->num_channels = 0; | 2375 | range->num_channels = 0; |
2376 | for (j = 0; j < sizeof(channel_table)/sizeof(channel_table[0]); j++) | 2376 | for (j = 0; j < ARRAY_SIZE(channel_table); j++) |
2377 | if (priv->reg_domain == channel_table[j].reg_domain) { | 2377 | if (priv->reg_domain == channel_table[j].reg_domain) { |
2378 | range->num_channels = channel_table[j].max - channel_table[j].min + 1; | 2378 | range->num_channels = channel_table[j].max - channel_table[j].min + 1; |
2379 | break; | 2379 | break; |
@@ -2579,9 +2579,9 @@ static const struct iw_priv_args atmel_private_args[] = { | |||
2579 | 2579 | ||
2580 | static const struct iw_handler_def atmel_handler_def = | 2580 | static const struct iw_handler_def atmel_handler_def = |
2581 | { | 2581 | { |
2582 | .num_standard = sizeof(atmel_handler)/sizeof(iw_handler), | 2582 | .num_standard = ARRAY_SIZE(atmel_handler), |
2583 | .num_private = sizeof(atmel_private_handler)/sizeof(iw_handler), | 2583 | .num_private = ARRAY_SIZE(atmel_private_handler), |
2584 | .num_private_args = sizeof(atmel_private_args)/sizeof(struct iw_priv_args), | 2584 | .num_private_args = ARRAY_SIZE(atmel_private_args), |
2585 | .standard = (iw_handler *) atmel_handler, | 2585 | .standard = (iw_handler *) atmel_handler, |
2586 | .private = (iw_handler *) atmel_private_handler, | 2586 | .private = (iw_handler *) atmel_private_handler, |
2587 | .private_args = (struct iw_priv_args *) atmel_private_args, | 2587 | .private_args = (struct iw_priv_args *) atmel_private_args, |
@@ -2645,7 +2645,7 @@ static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2645 | 2645 | ||
2646 | domain[REGDOMAINSZ] = 0; | 2646 | domain[REGDOMAINSZ] = 0; |
2647 | rc = -EINVAL; | 2647 | rc = -EINVAL; |
2648 | for (i = 0; i < sizeof(channel_table)/sizeof(channel_table[0]); i++) { | 2648 | for (i = 0; i < ARRAY_SIZE(channel_table); i++) { |
2649 | /* strcasecmp doesn't exist in the library */ | 2649 | /* strcasecmp doesn't exist in the library */ |
2650 | char *a = channel_table[i].name; | 2650 | char *a = channel_table[i].name; |
2651 | char *b = domain; | 2651 | char *b = domain; |