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)
}
/* execute sme */
static
void hostif_sme_execute(struct ks_wlan_private *priv, int event)
static void hostif_sme_execute(struct ks_wlan_private *priv, int event)
{
__le32 val;
u16 failure;
switch (event) {
case SME_START:
......@@ -2099,18 +2099,15 @@ void hostif_sme_execute(struct ks_wlan_private *priv, int event)
hostif_phy_information_request(priv);
break;
case SME_MIC_FAILURE_REQUEST:
if (priv->wpa.mic_failure.failure == 1) {
hostif_mic_failure_request(priv,
priv->wpa.mic_failure.failure - 1,
0);
} else if (priv->wpa.mic_failure.failure == 2) {
hostif_mic_failure_request(priv,
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);
failure = priv->wpa.mic_failure.failure;
if (failure != 1 && failure != 2) {
netdev_err(priv->net_dev,
"SME_MIC_FAILURE_REQUEST: failure count=%u error?\n",
failure);
return;
}
hostif_mic_failure_request(priv, failure - 1, (failure == 1) ?
0 : priv->wpa.mic_failure.counter);
break;
case SME_MIC_FAILURE_CONFIRM:
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