Commit f398c5f4 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: clean SME_MIC_FAILURE_REQUEST case in hostif_sme_execute

This commit cleans code for the event SME_MIC_FAILURE_REQUEST
changing if logic to handle invalid value first and using a
local variable.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e765861c
...@@ -2070,10 +2070,10 @@ void hostif_sme_set_pmksa(struct ks_wlan_private *priv) ...@@ -2070,10 +2070,10 @@ void hostif_sme_set_pmksa(struct ks_wlan_private *priv)
} }
/* execute sme */ /* execute sme */
static static void hostif_sme_execute(struct ks_wlan_private *priv, int event)
void hostif_sme_execute(struct ks_wlan_private *priv, int event)
{ {
__le32 val; __le32 val;
u16 failure;
switch (event) { switch (event) {
case SME_START: case SME_START:
...@@ -2099,18 +2099,15 @@ void hostif_sme_execute(struct ks_wlan_private *priv, int event) ...@@ -2099,18 +2099,15 @@ void hostif_sme_execute(struct ks_wlan_private *priv, int event)
hostif_phy_information_request(priv); hostif_phy_information_request(priv);
break; break;
case SME_MIC_FAILURE_REQUEST: case SME_MIC_FAILURE_REQUEST:
if (priv->wpa.mic_failure.failure == 1) { failure = priv->wpa.mic_failure.failure;
hostif_mic_failure_request(priv, if (failure != 1 && failure != 2) {
priv->wpa.mic_failure.failure - 1, netdev_err(priv->net_dev,
0); "SME_MIC_FAILURE_REQUEST: failure count=%u error?\n",
} else if (priv->wpa.mic_failure.failure == 2) { failure);
hostif_mic_failure_request(priv, return;
priv->wpa.mic_failure.failure - 1,
priv->wpa.mic_failure.counter);
} else {
netdev_err(priv->net_dev, "SME_MIC_FAILURE_REQUEST: failure count=%u error?\n",
priv->wpa.mic_failure.failure);
} }
hostif_mic_failure_request(priv, failure - 1, (failure == 1) ?
0 : priv->wpa.mic_failure.counter);
break; break;
case SME_MIC_FAILURE_CONFIRM: case SME_MIC_FAILURE_CONFIRM:
if (priv->wpa.mic_failure.failure == 2) { if (priv->wpa.mic_failure.failure == 2) {
......
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