Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102954
b: refs/heads/master
c: 5720508
h: refs/heads/master
v: v3
  • Loading branch information
Robert P. J. Day authored and John W. Linville committed Jun 14, 2008
1 parent 9a6a307 commit 633f6b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90d07349f8d754b89de8c61bdef9f95688900f30
refs/heads/master: 5720508d9ad9a82927875252b7a19ba2b45f11f8
8 changes: 3 additions & 5 deletions trunk/drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,7 @@ static void dsconfig_to_freq(unsigned int dsconfig, struct iw_freq *freq)
static int freq_to_dsconfig(struct iw_freq *freq, unsigned int *dsconfig)
{
if (freq->m < 1000 && freq->e == 0) {
if (freq->m >= 1 &&
freq->m <= (sizeof(freq_chan) / sizeof(freq_chan[0])))
if (freq->m >= 1 && freq->m <= ARRAY_SIZE(freq_chan))
*dsconfig = freq_chan[freq->m - 1] * 1000;
else
return -1;
Expand Down Expand Up @@ -1179,10 +1178,9 @@ static int rndis_iw_get_range(struct net_device *dev,
range->throughput = 11 * 1000 * 1000 / 2;
}

range->num_channels = (sizeof(freq_chan)/sizeof(freq_chan[0]));
range->num_channels = ARRAY_SIZE(freq_chan);

for (i = 0; i < (sizeof(freq_chan)/sizeof(freq_chan[0])) &&
i < IW_MAX_FREQUENCIES; i++) {
for (i = 0; i < ARRAY_SIZE(freq_chan) && i < IW_MAX_FREQUENCIES; i++) {
range->freq[i].i = i + 1;
range->freq[i].m = freq_chan[i] * 100000;
range->freq[i].e = 1;
Expand Down

0 comments on commit 633f6b9

Please sign in to comment.