summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/wext.c
diff options
context:
space:
mode:
authorAlejandro Martinez Ruiz <alex@flawedcode.org>2007-10-18 10:16:33 +0200
committerDavid S. Miller <davem@davemloft.net>2008-01-28 15:03:37 -0800
commitc00acf46deb18926931ba264510353cf22b98a79 (patch)
tree7b7105d3505cb13aa0474e0bd89b23d7b9f2b958 /drivers/net/wireless/libertas/wext.c
parent4c3616cdda0632a3d0e39069765f9ea0e6bd093e (diff)
downloadblackbird-obmc-linux-c00acf46deb18926931ba264510353cf22b98a79.tar.gz
blackbird-obmc-linux-c00acf46deb18926931ba264510353cf22b98a79.zip
netdev: ARRAY_SIZE() cleanups
Convert array size calculations to use ARRAY_SIZE(). Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r--drivers/net/wireless/libertas/wext.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 4dec5e5565bb..4ef5b9e00c77 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -52,11 +52,9 @@ struct chan_freq_power *libertas_find_cfp_by_band_and_channel(wlan_adapter * ada
{
struct chan_freq_power *cfp = NULL;
struct region_channel *rc;
- int count = sizeof(adapter->region_channel) /
- sizeof(adapter->region_channel[0]);
int i, j;
- for (j = 0; !cfp && (j < count); j++) {
+ for (j = 0; !cfp && (j < ARRAY_SIZE(adapter->region_channel)); j++) {
rc = &adapter->region_channel[j];
if (adapter->enable11d)
@@ -93,11 +91,9 @@ static struct chan_freq_power *find_cfp_by_band_and_freq(wlan_adapter * adapter,
{
struct chan_freq_power *cfp = NULL;
struct region_channel *rc;
- int count = sizeof(adapter->region_channel) /
- sizeof(adapter->region_channel[0]);
int i, j;
- for (j = 0; !cfp && (j < count); j++) {
+ for (j = 0; !cfp && (j < ARRAY_SIZE(adapter->region_channel)); j++) {
rc = &adapter->region_channel[j];
if (adapter->enable11d)
@@ -624,8 +620,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info,
}
if (!flag) {
for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
- && (j < sizeof(adapter->region_channel)
- / sizeof(adapter->region_channel[0])); j++) {
+ && (j < ARRAY_SIZE(adapter->region_channel)); j++) {
cfp = adapter->region_channel[j].CFP;
for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
&& adapter->region_channel[j].valid
OpenPOWER on IntegriCloud