All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] signed vs unsigned bug in ath9k
Date: Mon, 7 Dec 2009 13:07:36 +0200	[thread overview]
Message-ID: <20091207110736.GA1338@bicker> (raw)

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.

   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.

Another (uglier) option, is to declare ATH9K_RSSI_BAD like this:
#define ATH9K_RSSI_BAD                  ((int8_t)0x80) 

regards,
dan carpenter

             reply	other threads:[~2009-12-07 11:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 11:07 Dan Carpenter [this message]
2009-12-07 15:55 ` [ath9k-devel] signed vs unsigned bug in ath9k Luis R. Rodriguez
2009-12-08  8:20   ` Dan Carpenter
2009-12-08  8:20     ` Dan Carpenter
2009-12-08 14:42     ` [ath9k-devel] " John W. Linville
2009-12-08 14:42       ` John W. Linville
2009-12-08 16:08       ` [ath9k-devel] " Dan Carpenter
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=20091207110736.GA1338@bicker \
    --to=error27@gmail.com \
    --cc=ath9k-devel@lists.ath9k.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.