Commit 99e126fd authored by Bing Zhao's avatar Bing Zhao Committed by John W. Linville

mwifiex: fix coding style issue in mwifiex_deauthenticate

Documentation/CodingStyle says
"Do not unnecessarily use braces where a single statement will do."

Use "switch/case", instead of "if/else_if/else", so that more cases
can be added later.
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2a4ffa4c
...@@ -1377,19 +1377,21 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) ...@@ -1377,19 +1377,21 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac)
*/ */
int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac)
{ {
int ret = 0; if (!priv->media_connected)
return 0;
if (priv->media_connected) { switch (priv->bss_mode) {
if (priv->bss_mode == NL80211_IFTYPE_STATION) { case NL80211_IFTYPE_STATION:
ret = mwifiex_deauthenticate_infra(priv, mac); return mwifiex_deauthenticate_infra(priv, mac);
} else if (priv->bss_mode == NL80211_IFTYPE_ADHOC) { case NL80211_IFTYPE_ADHOC:
ret = mwifiex_send_cmd_sync(priv, return mwifiex_send_cmd_sync(priv,
HostCmd_CMD_802_11_AD_HOC_STOP, HostCmd_CMD_802_11_AD_HOC_STOP,
HostCmd_ACT_GEN_SET, 0, NULL); HostCmd_ACT_GEN_SET, 0, NULL);
} default:
break;
} }
return ret; return 0;
} }
EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); EXPORT_SYMBOL_GPL(mwifiex_deauthenticate);
......
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