All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] signed vs unsigned bug in ath9k
@ 2009-12-07 11:07 Dan Carpenter
  2009-12-07 15:55 ` Luis R. Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2009-12-07 11:07 UTC (permalink / raw)
  To: ath9k-devel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-12-08 16:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-07 11:07 [ath9k-devel] signed vs unsigned bug in ath9k Dan Carpenter
2009-12-07 15:55 ` 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

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.