diff options
author | Luciano Coelho <coelho@ti.com> | 2011-03-21 23:16:14 +0200 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-04-19 16:49:12 +0300 |
commit | 4a31c11c7d8c482598754a577a8fb71abb61ffa0 (patch) | |
tree | c43a18ce0e9ee6bc54dc3dcda83b2e6e3ae85438 /drivers/net/wireless/wl12xx/main.c | |
parent | 4623ec7d97afaf7a8489036e2c2e71e8349716b4 (diff) | |
download | lwn-4a31c11c7d8c482598754a577a8fb71abb61ffa0.tar.gz lwn-4a31c11c7d8c482598754a577a8fb71abb61ffa0.zip |
wl12xx: use a bitmask instead of list of booleans in scanned_ch
We were using an array of booleans to mark the channels we had already
scanned. This was causing a sparse error, because bool is not a type
with defined size. To fix this, use bitmasks instead, which is much
cleaner anyway.
Thanks Johannes Berg for the idea.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 85cb4daac9a0..9663326c0dfa 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c @@ -1423,8 +1423,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl) if (wl->scan.state != WL1271_SCAN_STATE_IDLE) { wl->scan.state = WL1271_SCAN_STATE_IDLE; - kfree(wl->scan.scanned_ch); - wl->scan.scanned_ch = NULL; + memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); wl->scan.req = NULL; ieee80211_scan_completed(wl->hw, true); } @@ -3502,6 +3501,10 @@ int wl1271_init_ieee80211(struct wl1271 *wl) wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_MAX_SIZE - sizeof(struct ieee80211_header); + /* make sure all our channels fit in the scanned_ch bitmask */ + BUILD_BUG_ON(ARRAY_SIZE(wl1271_channels) + + ARRAY_SIZE(wl1271_channels_5ghz) > + WL1271_MAX_CHANNELS); /* * We keep local copies of the band structs because we need to * modify them on a per-device basis. |