Commit ca946972 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

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: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1e4c7fb3
...@@ -765,18 +765,9 @@ static int ks_wlan_get_mode(struct net_device *dev, ...@@ -765,18 +765,9 @@ static int ks_wlan_get_mode(struct net_device *dev,
if (priv->sleep_mode == SLP_SLEEP) if (priv->sleep_mode == SLP_SLEEP)
return -EPERM; return -EPERM;
/* for SLEEP MODE */
/* If not managed, assume it's ad-hoc */ /* If not managed, assume it's ad-hoc */
switch (priv->reg.operation_mode) { uwrq->mode = (priv->reg.operation_mode == MODE_INFRASTRUCTURE) ?
case MODE_INFRASTRUCTURE: IW_MODE_INFRA : IW_MODE_ADHOC;
uwrq->mode = IW_MODE_INFRA;
break;
case MODE_ADHOC:
uwrq->mode = IW_MODE_ADHOC;
break;
default:
uwrq->mode = IW_MODE_ADHOC;
}
return 0; 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