linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>
Cc: "ath9k-devel@lists.ath9k.org" <ath9k-devel@lists.ath9k.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Luis Rodriguez <Luis.Rodriguez@Atheros.com>,
	Jouni Malinen <Jouni.Malinen@Atheros.com>,
	Vasanth Thiagarajan <Vasanth.Thiagarajan@Atheros.com>,
	Senthilkumar Balasubramanian
	<Senthilkumar.Balasubramanian@Atheros.com>,
	Sujith Manoharan <Sujith.Manoharan@Atheros.com>
Subject: Re: signed vs unsigned bug in ath9k
Date: Tue, 8 Dec 2009 10:20:32 +0200	[thread overview]
Message-ID: <20091208082031.GA29753@bicker> (raw)
In-Reply-To: <20091207155542.GB19643@tux>

On Mon, Dec 07, 2009 at 07:55:42AM -0800, Luis R. Rodriguez wrote:
> On Mon, Dec 07, 2009 at 03:07:36AM -0800, Dan Carpenter wrote:
> > drivers/net/wireless/ath/ath9k/recv.c
> >    205          sta = ieee80211_find_sta(sc->hw, hdr->addr2);
> >    206          if (sta) {
> >    207                  an = (struct ath_node *) sta->drv_priv;
> >    208                  if (ds->ds_rxstat.rs_rssi != ATH9K_RSSI_BAD &&
> > 
> > ds->ds_rxstat.rs_rssi is a signed 8 bit so it will never be == ATH9K_RSSI_BAD.
> 
> ATH9K_RSSI_BAD is -128 and the minimum value for int8_t is -128 so why is it a bug?
> 

It could be that someone fixed this already in the net tree?  In mainline it's still
positive 128.

#define ATH9K_RSSI_BAD                  0x80

regards,
dan carpenter

> >    209                     !ds->ds_rxstat.rs_moreaggr)
> >    210                          ATH_RSSI_LPF(an->last_rssi, ds->ds_rxstat.rs_rssi);
> >    211                  last_rssi = an->last_rssi;
> >    212          }
> > 
> > I would normally just change the declaration to unsigned but it looks like
> > someone may have chosen to have it signed on purpose.
> 
> Yeah it comes from hardware.
> 
>   Luis

       reply	other threads:[~2009-12-08  8:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20091207110736.GA1338@bicker>
     [not found] ` <20091207155542.GB19643@tux>
2009-12-08  8:20   ` Dan Carpenter [this message]
2009-12-08 14:42     ` signed vs unsigned bug in ath9k John W. Linville
2009-12-08 16:08       ` Dan Carpenter

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=20091208082031.GA29753@bicker \
    --to=error27@gmail.com \
    --cc=Jouni.Malinen@Atheros.com \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=Senthilkumar.Balasubramanian@Atheros.com \
    --cc=Sujith.Manoharan@Atheros.com \
    --cc=Vasanth.Thiagarajan@Atheros.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lrodriguez@atheros.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;
as well as URLs for NNTP newsgroup(s).