Commit 3188bc09 authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman

staging: ks7010: remove switch statement

Switch statement uses one [trivial] case and a default case holding
bulk of code. We can swap the switch statement with an if/return
statement as replacement for the original switch. This can be done
without changing the program logic.

Remove switch statement. Use original switch parameter as conditional
and return if conditional evaluates to true. Reduce level of
indentation. Do not change the program logic.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cf57e659
......@@ -183,10 +183,9 @@ static int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
if (priv->dev_state != DEVICE_STATE_SLEEP)
return 0;
switch (atomic_read(&priv->psstatus.status)) {
case PS_SNOOZE: /* 4 */
break;
default:
if (atomic_read(&priv->psstatus.status) == PS_SNOOZE)
return 0;
DPRINTK(5, "\npsstatus.status=%d\npsstatus.confirm_wait=%d\npsstatus.snooze_guard=%d\ncnt_txqbody=%d\n",
atomic_read(&priv->psstatus.status),
atomic_read(&priv->psstatus.confirm_wait),
......@@ -206,7 +205,7 @@ static int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
rw_data);
queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
&priv->ks_wlan_hw.rw_wq, 1);
break;
return 0;
}
if (!rw_data) {
rw_data = GCR_B_DOZE;
......@@ -222,7 +221,7 @@ static int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
queue_delayed_work
(priv->ks_wlan_hw.ks7010sdio_wq,
&priv->ks_wlan_hw.rw_wq, 1);
break;
return 0;
}
DPRINTK(4,
"PMG SET!! : GCR_B=%02X\n",
......@@ -239,8 +238,6 @@ static int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
&priv->ks_wlan_hw.rw_wq,
0);
}
break;
}
return 0;
}
......
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