Reduce stack usage in ar5112SetPowerTable() - eliminate tmpPowerTable
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Tue, 12 May 2009 16:44:36 +0000 (16:44 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Tue, 12 May 2009 16:44:36 +0000 (16:44 +0000)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4021 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath_hal/ar5212/ar5112.c

index b124b1abae3492738da8b0bae4dab90af07b29df..f011a9eaf5196d58c635139d0cf0a272577b19b3 100644 (file)
@@ -363,7 +363,6 @@ ar5112SetPowerTable(struct ath_hal *ah,
        uint16_t    numPcd;
        int16_t     powTableLXPD[2][64];
        int16_t     powTableHXPD[2][64];
-       int16_t     tmpPowerTable[64];
        uint16_t    xgainList[2];
        uint16_t    xpdMask;
 
@@ -430,11 +429,9 @@ ar5112SetPowerTable(struct ath_hal *ah,
                        OS_MEMCPY(&powers[0], &pRawCh->pDataPerXPD[jj].pwr_t4[0],
                                numPcd * sizeof(int16_t));
                        if (!getFullPwrTable(numPcd, &pcdacs[0], &powers[0],
-                               pRawCh->maxPower_t4, &tmpPowerTable[0])) {
+                               pRawCh->maxPower_t4, powTableLXPD[kk])) {
                                return AH_FALSE;
                        }
-                       OS_MEMCPY(&powTableLXPD[kk][0], &tmpPowerTable[0],
-                               64*sizeof(int16_t));
                } else {
                        jj = xgainList[0];
                        numPcd = pRawCh->pDataPerXPD[jj].numPcdacs;
@@ -444,11 +441,9 @@ ar5112SetPowerTable(struct ath_hal *ah,
                                &pRawCh->pDataPerXPD[jj].pwr_t4[0],
                                numPcd*sizeof(int16_t));
                        if (!getFullPwrTable(numPcd, &pcdacs[0], &powers[0],
-                               pRawCh->maxPower_t4, &tmpPowerTable[0])) {
+                               pRawCh->maxPower_t4, powTableLXPD[kk])) {
                                return AH_FALSE;
                        }
-                       OS_MEMCPY(&powTableLXPD[kk][0], &tmpPowerTable[0],
-                               64 * sizeof(int16_t));
 
                        jj = xgainList[1];
                        numPcd = pRawCh->pDataPerXPD[jj].numPcdacs;
@@ -458,11 +453,9 @@ ar5112SetPowerTable(struct ath_hal *ah,
                                &pRawCh->pDataPerXPD[jj].pwr_t4[0],
                                numPcd * sizeof(int16_t));
                        if (!getFullPwrTable(numPcd, &pcdacs[0], &powers[0],
-                               pRawCh->maxPower_t4, &tmpPowerTable[0])) {
+                               pRawCh->maxPower_t4, powTableHXPD[kk])) {
                                return AH_FALSE;
                        }
-                       OS_MEMCPY(&powTableHXPD[kk][0], &tmpPowerTable[0],
-                               64 * sizeof(int16_t));
                }
                kk++;
        }