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:
proski 2009-04-08 09:15:22 +00:00
parent c135dc326c
commit 1c2147eb68
10 changed files with 17 additions and 4 deletions

View File

@ -691,6 +691,7 @@ getGainF(struct ath_hal *ah, const struct tpcMap *pRD,
"%s: no valid entries in the pcdac table: %d\n", "%s: no valid entries in the pcdac table: %d\n",
__func__, pcdac); __func__, pcdac);
#endif #endif
*dBm = 0;
return 63; return 63;
} }
if (i >= AR_TP_SCALING_ENTRIES) { if (i >= AR_TP_SCALING_ENTRIES) {

View File

@ -63,8 +63,7 @@ ar5211BeaconInit(struct ath_hal *ah,
* interrupt; otherwise it sets the start of the next CFP. * interrupt; otherwise it sets the start of the next CFP.
*/ */
switch (AH_PRIVATE(ah)->ah_opmode) { switch (AH_PRIVATE(ah)->ah_opmode) {
case HAL_M_STA: default:
case HAL_M_MONITOR:
bt.bt_nextdba = 0xffff; bt.bt_nextdba = 0xffff;
bt.bt_nextswba = 0x7ffff; bt.bt_nextswba = 0x7ffff;
break; break;

View File

@ -1877,6 +1877,9 @@ ar5211GetLowerUpperValues(uint16_t value,
return; return;
} }
} }
HALASSERT(AH_FALSE); /* should not reach here */
*pLowerValue = *pList;
*pUpperValue = *pList;
} }
/* /*

View File

@ -295,6 +295,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
return; return;
} }
} }
HALASSERT(AH_FALSE); /* should not reach here */
*vlo = *vhi = 0;
} }
/* /*

View File

@ -271,6 +271,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
return; return;
} }
} }
HALASSERT(AH_FALSE); /* should not reach here */
*vlo = *vhi = 0;
} }
/* /*

View File

@ -289,6 +289,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
return; return;
} }
} }
HALASSERT(AH_FALSE); /* should not reach here */
*vlo = *vhi = 0;
} }
/* /*

View File

@ -290,6 +290,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
return; return;
} }
} }
HALASSERT(AH_FALSE); /* should not reach here */
*vlo = *vhi = 0;
} }
/* /*

View File

@ -76,8 +76,7 @@ ar5212BeaconInit(struct ath_hal *ah,
* interrupt; otherwise it sets the start of the next CFP. * interrupt; otherwise it sets the start of the next CFP.
*/ */
switch (AH_PRIVATE(ah)->ah_opmode) { switch (AH_PRIVATE(ah)->ah_opmode) {
case HAL_M_STA: default:
case HAL_M_MONITOR:
bt.bt_nextdba = 0xffff; bt.bt_nextdba = 0xffff;
bt.bt_nextswba = 0x7ffff; bt.bt_nextswba = 0x7ffff;
break; break;

View File

@ -2525,6 +2525,7 @@ ar5212GetLowerUpperValues(uint16_t v, uint16_t *lp, uint16_t listSize,
} }
} }
HALASSERT(AH_FALSE); /* should not reach here */ HALASSERT(AH_FALSE); /* should not reach here */
*vlo = *vhi = 0;
} }
/* /*

View File

@ -324,6 +324,8 @@ GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
return; return;
} }
} }
HALASSERT(AH_FALSE); /* should not reach here */
*vlo = *vhi = 0;
} }
/* /*