Commit f2bbb077 authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville

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: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 10d0b903
...@@ -255,25 +255,24 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, ...@@ -255,25 +255,24 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
} }
if (priv->bss_mode == NL80211_IFTYPE_STATION) { if (priv->bss_mode == NL80211_IFTYPE_STATION) {
u8 config_bands;
/* Infra mode */ /* Infra mode */
ret = mwifiex_deauthenticate(priv, NULL); ret = mwifiex_deauthenticate(priv, NULL);
if (ret) if (ret)
goto done; goto done;
if (bss_desc) { if (!bss_desc)
u8 config_bands = 0; return -1;
if (mwifiex_band_to_radio_type((u8) bss_desc->bss_band) if (mwifiex_band_to_radio_type(bss_desc->bss_band) ==
== HostCmd_SCAN_RADIO_TYPE_BG) HostCmd_SCAN_RADIO_TYPE_BG)
config_bands = BAND_B | BAND_G | BAND_GN | config_bands = BAND_B | BAND_G | BAND_GN | BAND_GAC;
BAND_GAC; else
else config_bands = BAND_A | BAND_AN | BAND_AAC;
config_bands = BAND_A | BAND_AN | BAND_AAC;
if (!((config_bands | adapter->fw_bands) & if (!((config_bands | adapter->fw_bands) & ~adapter->fw_bands))
~adapter->fw_bands)) adapter->config_bands = config_bands;
adapter->config_bands = config_bands;
}
ret = mwifiex_check_network_compatibility(priv, bss_desc); ret = mwifiex_check_network_compatibility(priv, bss_desc);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment