From: Bing Zhao Date: Wed, 2 May 2012 02:53:51 +0000 (-0700) Subject: mwifiex: fix coding style issue in mwifiex_deauthenticate X-Git-Tag: v3.5-rc1~101^2~6^2^2~136 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=99e126fdc04fb567567a6ec14317fae16a7a2de1;p=karo-tx-linux.git 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: Bing Zhao Signed-off-by: Avinash Patil Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 8a390982463e..aeb0b3fc4599 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c @@ -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 ret = 0; + if (!priv->media_connected) + return 0; - if (priv->media_connected) { - if (priv->bss_mode == NL80211_IFTYPE_STATION) { - ret = mwifiex_deauthenticate_infra(priv, mac); - } else if (priv->bss_mode == NL80211_IFTYPE_ADHOC) { - ret = mwifiex_send_cmd_sync(priv, - HostCmd_CMD_802_11_AD_HOC_STOP, - HostCmd_ACT_GEN_SET, 0, NULL); - } + switch (priv->bss_mode) { + case NL80211_IFTYPE_STATION: + return mwifiex_deauthenticate_infra(priv, mac); + case NL80211_IFTYPE_ADHOC: + return mwifiex_send_cmd_sync(priv, + HostCmd_CMD_802_11_AD_HOC_STOP, + HostCmd_ACT_GEN_SET, 0, NULL); + default: + break; } - return ret; + return 0; } EXPORT_SYMBOL_GPL(mwifiex_deauthenticate);