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@xxxxxxxxx> --- drivers/staging/ks7010/ks_wlan_net.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index d50a831..96629c9 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -762,18 +762,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; } -- 2.7.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel