mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 04:09:18 -04:00
staging: ks7010: refactor ks_wlan_get_mode function
Avoid the use of switch-case block which is not necessary at all and just use a ternary operator to achieve this. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1e4c7fb3a5
commit
ca94697252
@@ -765,18 +765,9 @@ static int ks_wlan_get_mode(struct net_device *dev,
|
||||
if (priv->sleep_mode == SLP_SLEEP)
|
||||
return -EPERM;
|
||||
|
||||
/* for SLEEP MODE */
|
||||
/* If not managed, assume it's ad-hoc */
|
||||
switch (priv->reg.operation_mode) {
|
||||
case MODE_INFRASTRUCTURE:
|
||||
uwrq->mode = IW_MODE_INFRA;
|
||||
break;
|
||||
case MODE_ADHOC:
|
||||
uwrq->mode = IW_MODE_ADHOC;
|
||||
break;
|
||||
default:
|
||||
uwrq->mode = IW_MODE_ADHOC;
|
||||
}
|
||||
uwrq->mode = (priv->reg.operation_mode == MODE_INFRASTRUCTURE) ?
|
||||
IW_MODE_INFRA : IW_MODE_ADHOC;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user