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: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct ks_wlan_private *priv = netdev_priv(dev);
struct iw_statistics *wstats = &priv->wstats;
- if (!atomic_read(&update_phyinfo)) {
- if (priv->dev_state < DEVICE_STATE_READY)
- return NULL; /* not finished initialize */
- else
- return wstats;
- }
+ if (!atomic_read(&update_phyinfo))
+ return (priv->dev_state < DEVICE_STATE_READY) ? NULL : wstats;
- /* Packets discarded in the wireless adapter due to wireless
+ /*
+ * Packets discarded in the wireless adapter due to wireless
* specific problems
*/
wstats->discard.nwid = 0; /* Rx invalid nwid */