Fix all instances of unused variables reported by gcc 4.6.0.

Change IEEE80211_NODE_SAVEQ_DEQUEUE to a compound statement returning a
value, which may or may not be ignored by the caller.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4137 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
proski 2011-05-03 21:56:02 +00:00
parent e408c071a2
commit ea28c77afc
14 changed files with 13 additions and 42 deletions

View File

@ -3277,7 +3277,6 @@ ath_ffstageq_flush(struct ath_softc *sc, struct ath_txq *txq,
int (*ath_ff_flushdonetest)(struct ath_txq *txq, struct ath_buf *bf))
{
struct ath_buf *bf_ff = NULL;
unsigned int pktlen;
int framecnt;
for (;;) {
@ -3305,7 +3304,6 @@ ath_ffstageq_flush(struct ath_softc *sc, struct ath_txq *txq,
sc->sc_stats.ast_tx_encap++;
goto bad;
}
pktlen = bf_ff->bf_skb->len; /* NB: don't reference skb below */
if (ath_tx_start(sc->sc_dev, ATH_BUF_NI(bf_ff), bf_ff,
bf_ff->bf_skb, 0) == 0)
continue;
@ -3483,7 +3481,6 @@ ath_hardstart(struct sk_buff *__skb, struct net_device *dev)
int requeue = 0;
#ifdef ATH_SUPERG_FF
struct ether_header *eh;
unsigned int pktlen;
struct ieee80211com *ic = &sc->sc_ic;
struct ath_txq *txq = NULL;
/* NB: NEVER free __skb, leave it alone and use original_skb instead!
@ -3663,7 +3660,6 @@ ath_hardstart(struct sk_buff *__skb, struct net_device *dev)
"failure\n");
sc->sc_stats.ast_tx_encap++;
} else {
pktlen = bf_ff->bf_skb->len; /* NB: don't reference skb below */
if (!ath_tx_start(dev, ni, bf_ff,
bf_ff->bf_skb, 0))
success = 1;
@ -4819,7 +4815,6 @@ ath_check_beacon_done(struct ath_softc *sc)
struct ieee80211vap *vap = NULL;
struct ath_vap *avp;
struct ath_buf *bf;
struct sk_buff *skb;
struct ath_desc *ds;
struct ath_tx_status *ts;
struct ath_hal *ah = sc->sc_ah;
@ -4838,7 +4833,6 @@ ath_check_beacon_done(struct ath_softc *sc)
return 0;
avp = ATH_VAP(vap);
bf = avp->av_bcbuf;
skb = bf->bf_skb;
ds = bf->bf_desc;
ts = &bf->bf_dsstatus.ds_txstat;
@ -6554,7 +6548,7 @@ ath_recv_mgmt(struct ieee80211vap * vap, struct ieee80211_node *ni_or_null,
struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
struct ieee80211_node * ni = ni_or_null;
u_int64_t hw_tsf, beacon_tsf;
u_int32_t hw_tu, beacon_tu, intval;
u_int32_t hw_tu;
int do_merge = 0;
if (ni_or_null == NULL)
@ -6623,7 +6617,6 @@ ath_recv_mgmt(struct ieee80211vap * vap, struct ieee80211_node *ni_or_null,
hw_tu = IEEE80211_TSF_TO_TU(hw_tsf);
beacon_tsf = le64_to_cpu(ni->ni_tstamp.tsf);
beacon_tu = IEEE80211_TSF_TO_TU(beacon_tsf);
DPRINTF(sc, ATH_DEBUG_BEACON,
"Beacon transmitted at %10llx, "
@ -6653,7 +6646,6 @@ ath_recv_mgmt(struct ieee80211vap * vap, struct ieee80211_node *ni_or_null,
do_merge = 1;
}
intval = ni->ni_intval & HAL_BEACON_PERIOD;
if (do_merge)
ieee80211_ibss_merge(ni);
}
@ -6688,7 +6680,6 @@ ath_rx_tasklet(TQUEUE_ARG data)
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc ? sc->sc_ah : NULL;
struct ath_desc *ds;
struct ath_rx_status *rs;
struct ieee80211_node *ni;
struct sk_buff *skb = NULL;
@ -6729,7 +6720,6 @@ ath_rx_tasklet(TQUEUE_ARG data)
break;
bf_processed++;
ds = bf->bf_desc;
#ifdef AR_DEBUG
if (sc->sc_debug & ATH_DEBUG_RECV_DESC)
@ -12389,12 +12379,10 @@ ath_rcv_dev_event(struct notifier_block *this, unsigned long event,
static void
ath_return_txbuf_locked(struct ath_softc *sc, struct ath_buf **bf)
{
struct ath_buf *bfaddr;
ATH_TXBUF_LOCK_ASSERT(sc);
if ((bf == NULL) || ((*bf) == NULL))
return;
bfaddr = *bf;
cleanup_ath_buf(sc, (*bf), BUS_DMA_TODEVICE);
STAILQ_INSERT_TAIL(&sc->sc_txbuf, (*bf), bf_list);
*bf = NULL;

View File

@ -181,7 +181,6 @@ eepromExpandPower5112(struct ath_hal *ah,
EEPROM_POWER_EXPN_5112 *pPowerExpn)
{
int ii, jj, kk;
int16_t maxPower_t4;
EXPN_DATA_PER_XPD_5112 *pExpnXPD;
/* ptr to array of info held per channel */
const EEPROM_DATA_PER_CHANNEL_5112 *pCalCh;
@ -218,7 +217,6 @@ eepromExpandPower5112(struct ath_hal *ah,
pCalCh->channelValue;
pPowerExpn->pDataPerChannel[ii].maxPower_t4 =
pCalCh->maxPower_t4;
maxPower_t4 = pPowerExpn->pDataPerChannel[ii].maxPower_t4;
for (jj = 0; jj < NUM_XPD_PER_CHANNEL; jj++)
pPowerExpn->pDataPerChannel[ii].pDataPerXPD[jj].numPcdacs = 0;

View File

@ -307,13 +307,12 @@ ar2316FillVpdTable(uint32_t pdGainIdx, int16_t Pmin, int16_t Pmax,
const int16_t *pwrList, const int16_t *VpdList,
uint16_t numIntercepts, uint16_t retVpdList[][64])
{
uint16_t ii, jj, kk;
uint16_t ii, kk;
int16_t currPwr = (int16_t)(2*Pmin);
/* since Pmin is pwr*2 and pwrList is 4*pwr */
uint32_t idxL, idxR;
ii = 0;
jj = 0;
if (numIntercepts < 2)
return AH_FALSE;

View File

@ -283,13 +283,12 @@ ar2317FillVpdTable(uint32_t pdGainIdx, int16_t Pmin, int16_t Pmax,
const int16_t *pwrList, const int16_t *VpdList,
uint16_t numIntercepts, uint16_t retVpdList[][64])
{
uint16_t ii, jj, kk;
uint16_t ii, kk;
int16_t currPwr = (int16_t)(2*Pmin);
/* since Pmin is pwr*2 and pwrList is 4*pwr */
uint32_t idxL, idxR;
ii = 0;
jj = 0;
if (numIntercepts < 2)
return AH_FALSE;
@ -612,14 +611,12 @@ ar2317GetMaxPower(struct ath_hal *ah, const RAW_DATA_PER_CHANNEL_2317 *data)
{
uint32_t ii;
uint16_t Pmax=0,numVpd;
uint16_t vpdmax;
for (ii=0; ii< MAX_NUM_PDGAINS_PER_CHANNEL; ii++) {
/* work forwards cuase lowest pdGain for highest power */
numVpd = data->pDataPerPDGain[ii].numVpd;
if (numVpd > 0) {
Pmax = data->pDataPerPDGain[ii].pwr_t4[numVpd-1];
vpdmax = data->pDataPerPDGain[ii].Vpd[numVpd-1];
return(Pmax);
}
}

View File

@ -301,13 +301,12 @@ ar2413FillVpdTable(uint32_t pdGainIdx, int16_t Pmin, int16_t Pmax,
const int16_t *pwrList, const uint16_t *VpdList,
uint16_t numIntercepts, uint16_t retVpdList[][64])
{
uint16_t ii, jj, kk;
uint16_t ii, kk;
int16_t currPwr = (int16_t)(2*Pmin);
/* since Pmin is pwr*2 and pwrList is 4*pwr */
uint32_t idxL, idxR;
ii = 0;
jj = 0;
if (numIntercepts < 2)
return AH_FALSE;

View File

@ -303,13 +303,12 @@ ar2425FillVpdTable(uint32_t pdGainIdx, int16_t Pmin, int16_t Pmax,
uint16_t numIntercepts,
uint16_t retVpdList[][64])
{
uint16_t ii, jj, kk;
uint16_t ii, kk;
int16_t currPwr = (int16_t)(2*Pmin);
/* since Pmin is pwr*2 and pwrList is 4*pwr */
uint32_t idxL, idxR;
ii = 0;
jj = 0;
if (numIntercepts < 2)
return AH_FALSE;

View File

@ -337,13 +337,12 @@ ar5413FillVpdTable(uint32_t pdGainIdx, int16_t Pmin, int16_t Pmax,
uint16_t numIntercepts,
uint16_t retVpdList[][64])
{
uint16_t ii, jj, kk;
uint16_t ii, kk;
int16_t currPwr = (int16_t)(2*Pmin);
/* since Pmin is pwr*2 and pwrList is 4*pwr */
uint32_t idxL, idxR;
ii = 0;
jj = 0;
if (numIntercepts < 2)
return AH_FALSE;

View File

@ -138,7 +138,7 @@ ar5416ResetStaBeaconTimers(struct ath_hal *ah)
void
ar5416SetStaBeaconTimers(struct ath_hal *ah, const HAL_BEACON_STATE *bs)
{
uint32_t nextTbtt, nextdtim,beaconintval, dtimperiod;
uint32_t nextTbtt, beaconintval, dtimperiod;
HALASSERT(bs->bs_intval != 0);
@ -214,7 +214,6 @@ ar5416SetStaBeaconTimers(struct ath_hal *ah, const HAL_BEACON_STATE *bs)
nextTbtt = bs->bs_nextdtim;
else
nextTbtt = bs->bs_nexttbtt;
nextdtim = bs->bs_nextdtim;
OS_REG_WRITE(ah, AR_NEXT_DTIM,
TU_TO_USEC(bs->bs_nextdtim - SLEEP_SLOP));

View File

@ -308,13 +308,12 @@ ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore)
static void
ar9280WriteIni(struct ath_hal *ah, const HAL_CHANNEL *chan)
{
u_int modesIndex, freqIndex;
u_int modesIndex;
int regWrites = 0;
/* Setup the indices for the next set of register array writes */
/* XXX Ignore 11n dynamic mode on the AR5416 for the moment */
if (IS_CHAN_2GHZ(chan)) {
freqIndex = 2;
if (IS_CHAN_HT40(chan))
modesIndex = 3;
else if (IS_CHAN_108G(chan))
@ -322,7 +321,6 @@ ar9280WriteIni(struct ath_hal *ah, const HAL_CHANNEL *chan)
else
modesIndex = 4;
} else {
freqIndex = 1;
if (IS_CHAN_HT40(chan) ||
IS_CHAN_TURBO(chan))
modesIndex = 2;

View File

@ -225,7 +225,6 @@ calc_usecs_unicast_packet(struct ath_softc *sc, int length,
rts = 1;
if (rts || cts) {
int ctsrate;
int ctsduration = 0;
if (!rt->info[cix].rateKbps) {
@ -237,7 +236,6 @@ calc_usecs_unicast_packet(struct ath_softc *sc, int length,
}
ctsrate = rt->info[cix].rateCode | rt->info[cix].shortPreamble;
if (rts) /* SIFS + CTS */
ctsduration += rt->info[cix].spAckDuration;

View File

@ -197,7 +197,6 @@ ieee80211_beacon_alloc(struct ieee80211_node *ni,
struct sk_buff *skb;
int pktlen;
u_int8_t *frm;
struct ieee80211_rateset *rs;
/*
* beacon frame format
@ -220,7 +219,6 @@ ieee80211_beacon_alloc(struct ieee80211_node *ni,
* XXX Vendor-specific OIDs (e.g. Atheros)
* NB: we allocate the max space required for the TIM bitmap.
*/
rs = &ni->ni_rates;
pktlen = 8 /* time stamp */
+ sizeof(u_int16_t) /* beacon interval */
+ sizeof(u_int16_t) /* capability information */

View File

@ -4144,7 +4144,7 @@ ieee80211_recv_pspoll(struct ieee80211_node *ni, struct sk_buff *skb0)
/* Okay, take the first queued packet and put it out... */
IEEE80211_NODE_SAVEQ_LOCK_IRQ(ni);
IEEE80211_NODE_SAVEQ_DEQUEUE(ni, skb, qlen);
qlen = IEEE80211_NODE_SAVEQ_DEQUEUE(ni, skb);
IEEE80211_NODE_SAVEQ_UNLOCK_IRQ(ni);
if (skb == NULL) {
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_POWER, wh->i_addr2,

View File

@ -362,10 +362,10 @@ typedef spinlock_t acl_lock_t;
#endif
/* caller MUST lock IEEE80211_NODE_SAVEQ */
#define IEEE80211_NODE_SAVEQ_DEQUEUE(_ni, _skb, _qlen) do { \
#define IEEE80211_NODE_SAVEQ_DEQUEUE(_ni, _skb) ({ \
_skb = __skb_dequeue(&(_ni)->ni_savedq); \
(_qlen) = skb_queue_len(&(_ni)->ni_savedq); \
} while (0)
skb_queue_len(&(_ni)->ni_savedq); \
})
#define _IEEE80211_NODE_SAVEQ_ENQUEUE(_ni, _skb, _qlen, _age) do { \
struct sk_buff *tail = skb_peek_tail(&(_ni)->ni_savedq); \
if (tail != NULL) { \

View File

@ -304,10 +304,9 @@ ieee80211_node_pwrsave(struct ieee80211_node *ni, int enable)
for (;;) {
struct sk_buff *skb;
int qlen;
IEEE80211_NODE_SAVEQ_LOCK_IRQ(ni);
IEEE80211_NODE_SAVEQ_DEQUEUE(ni, skb, qlen);
IEEE80211_NODE_SAVEQ_DEQUEUE(ni, skb);
IEEE80211_NODE_SAVEQ_UNLOCK_IRQ(ni);
if (skb == NULL)
break;