aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/wext.c
diff options
context:
space:
mode:
authorAlejandro Martinez Ruiz <alex@flawedcode.org>2007-10-18 04:16:33 -0400
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:03:37 -0500
commitc00acf46deb18926931ba264510353cf22b98a79 (patch)
tree7b7105d3505cb13aa0474e0bd89b23d7b9f2b958 /drivers/net/wireless/libertas/wext.c
parent4c3616cdda0632a3d0e39069765f9ea0e6bd093e (diff)
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
52{ 52{
53 struct chan_freq_power *cfp = NULL; 53 struct chan_freq_power *cfp = NULL;
54 struct region_channel *rc; 54 struct region_channel *rc;
55 int count = sizeof(adapter->region_channel) /
56 sizeof(adapter->region_channel[0]);
57 int i, j; 55 int i, j;
58 56
59 for (j = 0; !cfp && (j < count); j++) { 57 for (j = 0; !cfp && (j < ARRAY_SIZE(adapter->region_channel)); j++) {
60 rc = &adapter->region_channel[j]; 58 rc = &adapter->region_channel[j];
61 59
62 if (adapter->enable11d) 60 if (adapter->enable11d)
@@ -93,11 +91,9 @@ static struct chan_freq_power *find_cfp_by_band_and_freq(wlan_adapter * adapter,
93{ 91{
94 struct chan_freq_power *cfp = NULL; 92 struct chan_freq_power *cfp = NULL;
95 struct region_channel *rc; 93 struct region_channel *rc;
96 int count = sizeof(adapter->region_channel) /
97 sizeof(adapter->region_channel[0]);
98 int i, j; 94 int i, j;
99 95
100 for (j = 0; !cfp && (j < count); j++) { 96 for (j = 0; !cfp && (j < ARRAY_SIZE(adapter->region_channel)); j++) {
101 rc = &adapter->region_channel[j]; 97 rc = &adapter->region_channel[j];
102 98
103 if (adapter->enable11d) 99 if (adapter->enable11d)
@@ -624,8 +620,7 @@ static int wlan_get_range(struct net_device *dev, struct iw_request_info *info,
624 } 620 }
625 if (!flag) { 621 if (!flag) {
626 for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES) 622 for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
627 && (j < sizeof(adapter->region_channel) 623 && (j < ARRAY_SIZE(adapter->region_channel)); j++) {
628 / sizeof(adapter->region_channel[0])); j++) {
629 cfp = adapter->region_channel[j].CFP; 624 cfp = adapter->region_channel[j].CFP;
630 for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES) 625 for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
631 && adapter->region_channel[j].valid 626 && adapter->region_channel[j].valid