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

staging: ks7010: fix checkpatch UNNECESSARY_ELSE

Checkpatch emits WARNING: else is not generally useful after a break
or return. Two warnings of this type are emitted for this code block,
in both cases 'else' statements are unnecessary.

Remove unnecessary 'else' statements, reduce indentation in subsequent
code.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f0ef774
...@@ -202,6 +202,7 @@ static int ks_wlan_set_freq(struct net_device *dev, ...@@ -202,6 +202,7 @@ static int ks_wlan_set_freq(struct net_device *dev,
{ {
struct ks_wlan_private *priv = struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev); (struct ks_wlan_private *)netdev_priv(dev);
int channel;
if (priv->sleep_mode == SLP_SLEEP) if (priv->sleep_mode == SLP_SLEEP)
return -EPERM; return -EPERM;
...@@ -220,24 +221,22 @@ static int ks_wlan_set_freq(struct net_device *dev, ...@@ -220,24 +221,22 @@ static int ks_wlan_set_freq(struct net_device *dev,
fwrq->m = c + 1; fwrq->m = c + 1;
} }
/* Setting by channel number */ /* Setting by channel number */
if ((fwrq->m > 1000) || (fwrq->e > 0)) { if ((fwrq->m > 1000) || (fwrq->e > 0))
return -EOPNOTSUPP; return -EOPNOTSUPP;
} else {
int channel = fwrq->m; channel = fwrq->m;
/* We should do a better check than that, /* We should do a better check than that,
* based on the card capability !!! * based on the card capability !!!
*/ */
if ((channel < 1) || (channel > 14)) { if ((channel < 1) || (channel > 14)) {
netdev_dbg(dev, netdev_dbg(dev, "%s: New channel value of %d is invalid!\n",
"%s: New channel value of %d is invalid!\n",
dev->name, fwrq->m); dev->name, fwrq->m);
return -EINVAL; return -EINVAL;
} else { }
/* Yes ! We can set it !!! */ /* Yes ! We can set it !!! */
priv->reg.channel = (u8)(channel); priv->reg.channel = (u8)(channel);
priv->need_commit |= SME_MODE_SET; priv->need_commit |= SME_MODE_SET;
}
}
return -EINPROGRESS; /* Call commit handler */ return -EINPROGRESS; /* Call commit handler */
} }
......
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