summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2018-04-16 12:29:29 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-23 14:29:50 +0200
commitd6a72502e3f37f4ae8118c724cf269a17dc73529 (patch)
tree8d8b040b77c164c65fb4a6e872fc11096f9fa0b0
parentd3bef56b75ca494bcf249c760152bdb03e488da5 (diff)
staging: ks7010: refactor code for hostif_sme_sleep_set function
This commit refactors code for hostif_sme_sleep_set function. This function was using a switch-case block to handle only two states where the action to do for them is the same. Just refactor a bit to check for return condition at first and doing the common action after in other case. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/ks7010/ks_hostif.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 22033628db05..04688e1841e9 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2043,19 +2043,13 @@ void hostif_sme_power_mgmt_set(struct ks_wlan_private *priv)
hostif_power_mgmt_request(priv, mode, wake_up, receive_dtims);
}
-static
-void hostif_sme_sleep_set(struct ks_wlan_private *priv)
+static void hostif_sme_sleep_set(struct ks_wlan_private *priv)
{
- switch (priv->sleep_mode) {
- case SLP_SLEEP:
- hostif_sleep_request(priv, priv->sleep_mode);
- break;
- case SLP_ACTIVE:
- hostif_sleep_request(priv, priv->sleep_mode);
- break;
- default:
- break;
- }
+ if (priv->sleep_mode != SLP_SLEEP &&
+ priv->sleep_mode != SLP_ACTIVE)
+ return;
+
+ hostif_sleep_request(priv, priv->sleep_mode);
}
static