linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8712: fix negative level value
@ 2015-10-11 13:16 Luis de Bethencourt
  0 siblings, 0 replies; only message in thread
From: Luis de Bethencourt @ 2015-10-11 13:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: Larry.Finger, florian.c.schilhabel, gregkh, stillcompiling,
	vthakkar1994, hamohammed.sa, dan.carpenter, mahfouz.saif.elyazal,
	sudipm.mukherjee, cristina.opriceana, Julia.Lawall, amsfield22,
	devel, Luis de Bethencourt

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 <luisbg@osg.samsung.com>
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 57ec8df..4e6db88 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;
-- 
2.5.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-11 13:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-11 13:16 [PATCH] staging: rtl8712: fix negative level value Luis de Bethencourt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).