mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
To: Luis de Bethencourt <luisbg@osg.samsung.com>,
	linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, cristina.opriceana@gmail.com,
	devel@driverdev.osuosl.org
Subject: Re: [PATCH] staging: rtl8192e: rtl_wx: fix negative noise value
Date: Thu, 1 Oct 2015 19:58:01 +0200	[thread overview]
Message-ID: <560D7429.30401@gmail.com> (raw)
In-Reply-To: <1443615131-18867-1-git-send-email-luisbg@osg.samsung.com>

On 30.09.2015 14:12, Luis de Bethencourt wrote:
> wstats->qual.noise is of type uint8, so it shouldn't be assigned a
> negative number. Assigning it 0x100 - 100, which is the equivalent
> to -100 dBm when IW_QUAL_DBM is set.
> 
> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> index 984cb9a..70df6a1 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> @@ -1225,7 +1225,7 @@ static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev)
>  	if (ieee->state < RTLLIB_LINKED) {
>  		wstats->qual.qual = 10;
>  		wstats->qual.level = 0;
> -		wstats->qual.noise = -100;
> +		wstats->qual.noise = 0x100 - 100;	/* -100 dBm */
>  		wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
>  		return wstats;
>  	}
> 


Tested-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

Although I still don't understand why someone wanted to have unsigned noise
(historical reasons perhaps?)


Mateusz

      reply	other threads:[~2015-10-01 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 12:12 Luis de Bethencourt
2015-10-01 17:58 ` Mateusz Kulikowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560D7429.30401@gmail.com \
    --to=mateusz.kulikowski@gmail.com \
    --cc=cristina.opriceana@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luisbg@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®