[PATCH] libertas: fix WEXT quality reporting
authorDan Williams <dcbw@redhat.com>
Thu, 2 Aug 2007 17:06:54 +0000 (13:06 -0400)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:50:00 +0000 (16:50 -0700)
Found by Ronak and others at Marvell.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/wext.c

index e8c0629f9a4bdde794e3a85c48dc43a5cf3aa5bc..7d14f9c2aff63c83761f26120f9f655b0086af69 100644 (file)
@@ -949,7 +949,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
        priv->wstats.discard.misc = le16_to_cpu(adapter->logmsg.ackfailure);
 
        /* Calculate quality */
-       priv->wstats.qual.qual = max(quality, (u32)100);
+       priv->wstats.qual.qual = min_t(u32, quality, 100);
        priv->wstats.qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
        stats_valid = 1;