From: Sergio Paracuellos Date: Wed, 25 Apr 2018 14:01:51 +0000 (+0200) Subject: staging: ks7010: avoid an 'else' in ks_wlan_set_power X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f3b0bd23956524c8c98ce0a25f7b7bf897d4af85;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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);