mirror of
https://github.com/proski/madwifi
synced 2024-11-24 23:40:00 +03:00
Fix compiler errors with -O3
When the compiler tries inlining static functions, it can notice that some variables may not be initialized in the functions being inlined. Provide initialization for output variables in all branches of execution, no matter how anomalous. Add asserts in some cases. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3988 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
parent
c135dc326c
commit
1c2147eb68
@ -691,6 +691,7 @@ getGainF(struct ath_hal *ah, const struct tpcMap *pRD,
|
||||
"%s: no valid entries in the pcdac table: %d\n",
|
||||
__func__, pcdac);
|
||||
#endif
|
||||
*dBm = 0;
|
||||
return 63;
|
||||
}
|
||||
if (i >= AR_TP_SCALING_ENTRIES) {
|
||||
|
@ -63,8 +63,7 @@ ar5211BeaconInit(struct ath_hal *ah,
|
||||
* interrupt; otherwise it sets the start of the next CFP.
|
||||
*/
|
||||
switch (AH_PRIVATE(ah)->ah_opmode) {
|
||||
case HAL_M_STA:
|
||||
case HAL_M_MONITOR:
|
||||
default:
|
||||
bt.bt_nextdba = 0xffff;
|
||||
bt.bt_nextswba = 0x7ffff;
|
||||
break;
|
||||
|
@ -1877,6 +1877,9 @@ ar5211GetLowerUpperValues(uint16_t value,
|
||||
return;
|
||||
}
|
||||
}
|
||||
HALASSERT(AH_FALSE); /* should not reach here */
|
||||
*pLowerValue = *pList;
|
||||
*pUpperValue = *pList;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -295,6 +295,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
|
||||
return;
|
||||
}
|
||||
}
|
||||
HALASSERT(AH_FALSE); /* should not reach here */
|
||||
*vlo = *vhi = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -271,6 +271,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
|
||||
return;
|
||||
}
|
||||
}
|
||||
HALASSERT(AH_FALSE); /* should not reach here */
|
||||
*vlo = *vhi = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -289,6 +289,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
|
||||
return;
|
||||
}
|
||||
}
|
||||
HALASSERT(AH_FALSE); /* should not reach here */
|
||||
*vlo = *vhi = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -290,6 +290,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
|
||||
return;
|
||||
}
|
||||
}
|
||||
HALASSERT(AH_FALSE); /* should not reach here */
|
||||
*vlo = *vhi = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -76,8 +76,7 @@ ar5212BeaconInit(struct ath_hal *ah,
|
||||
* interrupt; otherwise it sets the start of the next CFP.
|
||||
*/
|
||||
switch (AH_PRIVATE(ah)->ah_opmode) {
|
||||
case HAL_M_STA:
|
||||
case HAL_M_MONITOR:
|
||||
default:
|
||||
bt.bt_nextdba = 0xffff;
|
||||
bt.bt_nextswba = 0x7ffff;
|
||||
break;
|
||||
|
@ -2525,6 +2525,7 @@ ar5212GetLowerUpperValues(uint16_t v, uint16_t *lp, uint16_t listSize,
|
||||
}
|
||||
}
|
||||
HALASSERT(AH_FALSE); /* should not reach here */
|
||||
*vlo = *vhi = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -324,6 +324,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
|
||||
return;
|
||||
}
|
||||
}
|
||||
HALASSERT(AH_FALSE); /* should not reach here */
|
||||
*vlo = *vhi = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user