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

staging: ks7010: invert conditional, reduce indent

Function _ks_wlan_hw_power_save has 5 levels of indentation. Reducing
the amount of indentation may make code clearer to read. Also a number
of other checkpatch warnings may be removed if we first reduce the
level of indentation in this function.

Invert conditional and return from function if new conditional
evaluates to true. Repeat on subsequent conditional. Reduce
indentation without changing the program logic.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d642eaa
......@@ -176,9 +176,13 @@ static int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
if (priv->reg.powermgt == POWMGT_ACTIVE_MODE)
return 0;
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE &&
(priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
if (priv->dev_state == DEVICE_STATE_SLEEP) {
if (priv->reg.operation_mode != MODE_INFRASTRUCTURE ||
(priv->connect_status & CONNECT_STATUS_MASK) != CONNECT_STATUS)
return 0;
if (priv->dev_state != DEVICE_STATE_SLEEP)
return 0;
switch (atomic_read(&priv->psstatus.status)) {
case PS_SNOOZE: /* 4 */
break;
......@@ -239,8 +243,6 @@ static int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
}
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