From f3b0bd23956524c8c98ce0a25f7b7bf897d4af85 Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Wed, 25 Apr 2018 16:01:51 +0200 Subject: [PATCH] staging: ks7010: avoid an 'else' in ks_wlan_set_power Change if logic to handle invalid case for operation_mode at first avoiding an 'else' path. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/ks_wlan_net.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 45f850a20ed6..9d79af9eefc8 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -1045,10 +1045,9 @@ static int ks_wlan_set_power(struct net_device *dev, if (vwrq->power.disabled) { priv->reg.power_mgmt = POWER_MGMT_ACTIVE; } else { - if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) - priv->reg.power_mgmt = POWER_MGMT_SAVE1; - else + if (priv->reg.operation_mode != MODE_INFRASTRUCTURE) return -EINVAL; + priv->reg.power_mgmt = POWER_MGMT_SAVE1; } hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST); -- 2.30.2