mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
staging: ks7010: refactor ks_wlan_set_beacon_lost function
Change if condition to handle invalid value first and avoid nonsense else's path improving readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ad9bd58c2a
commit
25ee63eb2d
1 changed files with 5 additions and 5 deletions
|
|
@ -1973,17 +1973,17 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev,
|
|||
if (priv->sleep_mode == SLP_SLEEP)
|
||||
return -EPERM;
|
||||
/* for SLEEP MODE */
|
||||
if (*uwrq >= BEACON_LOST_COUNT_MIN && *uwrq <= BEACON_LOST_COUNT_MAX)
|
||||
priv->reg.beacon_lost_count = *uwrq;
|
||||
else
|
||||
if (*uwrq < BEACON_LOST_COUNT_MIN || *uwrq > BEACON_LOST_COUNT_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
priv->reg.beacon_lost_count = *uwrq;
|
||||
|
||||
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
|
||||
priv->need_commit |= SME_MODE_SET;
|
||||
return -EINPROGRESS; /* Call commit handler */
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ks_wlan_get_beacon_lost(struct net_device *dev,
|
||||
|
|
|
|||
Loading…
Reference in a new issue