From: Dan Williams Date: Thu, 2 Aug 2007 17:06:54 +0000 (-0400) Subject: [PATCH] libertas: fix WEXT quality reporting X-Git-Tag: v2.6.24-rc1~1454^2~611 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b20c520763a6fe1aabde27f6ba017a67f22f90d5;p=linux-2.6 [PATCH] libertas: fix WEXT quality reporting Found by Ronak and others at Marvell. Signed-off-by: Dan Williams Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index e8c0629f9a..7d14f9c2af 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c @@ -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;