From: Luis de Bethencourt Date: Sun, 11 Oct 2015 13:16:57 +0000 (+0100) Subject: staging: rtl8712: fix negative level value X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=681cd988d3587ca2b3afa3db598a2ecab572b742;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8712: fix negative level value range->avg_qual.level is of type uint8, so it shouldn't be assigned a negative number. Assigning it 0x100 - 78, which is the equivalent to (20 + -98) dBm when IW_QUAL_DBM is set. Signed-off-by: Luis de Bethencourt Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index 57ec8dfacc8b..4e6db88e36ff 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -883,7 +883,7 @@ static int r8711_wx_get_range(struct net_device *dev, range->max_qual.updated = 7; /* Updated all three */ range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */ /* TODO: Find real 'good' to 'bad' threshold value for RSSI */ - range->avg_qual.level = 20 + -98; + range->avg_qual.level = 0x100 - 78; range->avg_qual.noise = 0; range->avg_qual.updated = 7; /* Updated all three */ range->num_bitrates = RATE_COUNT;