diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2013-06-18 19:36:56 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-19 15:28:20 -0400 |
commit | f2bbb07729f04bd8efa3f3285f19ba0609e42017 (patch) | |
tree | 51eebeca0bb763487d527d25cdd841955e913c26 /drivers/net/wireless/mwifiex | |
parent | 10d0b9030a3f86e1e26c710c7580524d7787d688 (diff) |
mwifiex: code rearrangement for better readability
Use negative check (if(!bss_desc)) and return failure
instead of failing a NULL check later in
mwifiex_check_network_compatibility() routine.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 23aa910bc5d0..15b5457fa4e5 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -255,25 +255,24 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | |||
255 | } | 255 | } |
256 | 256 | ||
257 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { | 257 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { |
258 | u8 config_bands; | ||
259 | |||
258 | /* Infra mode */ | 260 | /* Infra mode */ |
259 | ret = mwifiex_deauthenticate(priv, NULL); | 261 | ret = mwifiex_deauthenticate(priv, NULL); |
260 | if (ret) | 262 | if (ret) |
261 | goto done; | 263 | goto done; |
262 | 264 | ||
263 | if (bss_desc) { | 265 | if (!bss_desc) |
264 | u8 config_bands = 0; | 266 | return -1; |
265 | 267 | ||
266 | if (mwifiex_band_to_radio_type((u8) bss_desc->bss_band) | 268 | if (mwifiex_band_to_radio_type(bss_desc->bss_band) == |
267 | == HostCmd_SCAN_RADIO_TYPE_BG) | 269 | HostCmd_SCAN_RADIO_TYPE_BG) |
268 | config_bands = BAND_B | BAND_G | BAND_GN | | 270 | config_bands = BAND_B | BAND_G | BAND_GN | BAND_GAC; |
269 | BAND_GAC; | 271 | else |
270 | else | 272 | config_bands = BAND_A | BAND_AN | BAND_AAC; |
271 | config_bands = BAND_A | BAND_AN | BAND_AAC; | ||
272 | 273 | ||
273 | if (!((config_bands | adapter->fw_bands) & | 274 | if (!((config_bands | adapter->fw_bands) & ~adapter->fw_bands)) |
274 | ~adapter->fw_bands)) | 275 | adapter->config_bands = config_bands; |
275 | adapter->config_bands = config_bands; | ||
276 | } | ||
277 | 276 | ||
278 | ret = mwifiex_check_network_compatibility(priv, bss_desc); | 277 | ret = mwifiex_check_network_compatibility(priv, bss_desc); |
279 | if (ret) | 278 | if (ret) |