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

staging: ks7010: refactor ks_get_wireless_stats function

This commit refactor a bit ks_get_wireless_stats using
ternary operator for return code. It also change a comment
to use preferred style.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2d1de1e3
...@@ -1743,14 +1743,11 @@ static struct iw_statistics *ks_get_wireless_stats(struct net_device *dev) ...@@ -1743,14 +1743,11 @@ static struct iw_statistics *ks_get_wireless_stats(struct net_device *dev)
struct ks_wlan_private *priv = netdev_priv(dev); struct ks_wlan_private *priv = netdev_priv(dev);
struct iw_statistics *wstats = &priv->wstats; struct iw_statistics *wstats = &priv->wstats;
if (!atomic_read(&update_phyinfo)) { if (!atomic_read(&update_phyinfo))
if (priv->dev_state < DEVICE_STATE_READY) return (priv->dev_state < DEVICE_STATE_READY) ? NULL : wstats;
return NULL; /* not finished initialize */
else
return wstats;
}
/* Packets discarded in the wireless adapter due to wireless /*
* Packets discarded in the wireless adapter due to wireless
* specific problems * specific problems
*/ */
wstats->discard.nwid = 0; /* Rx invalid nwid */ wstats->discard.nwid = 0; /* Rx invalid nwid */
......
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