From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Mon, 7 Dec 2009 13:07:36 +0200 Subject: [ath9k-devel] signed vs unsigned bug in ath9k Message-ID: <20091207110736.GA1338@bicker> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org 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