staging: vt6656: Remove always true bUpdateBBVGA
authorMalcolm Priestley <tvboxspy@gmail.com>
Sat, 17 May 2014 08:50:39 +0000 (09:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 May 2014 16:58:31 +0000 (09:58 -0700)
Remove true if statements.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/bssdb.c
drivers/staging/vt6656/device.h
drivers/staging/vt6656/main_usb.c
drivers/staging/vt6656/wcmd.c
drivers/staging/vt6656/wmgr.c

index 7e8e67a460ca94fa7605d469b38cd9c4b0bf18dc..de60c99601d446260a0a16e4e3c14d3863dd87a9 100644 (file)
@@ -455,16 +455,14 @@ int BSSbInsertToBSSList(struct vnt_private *pDevice,
                }
        }
 
-       if (pDevice->bUpdateBBVGA) {
-               /* Monitor if RSSI is too strong. */
-               pBSSList->byRSSIStatCnt = 0;
-               RFvRSSITodBm(pDevice, (u8) (pRxPacket->uRSSI),
+       /* Monitor if RSSI is too strong. */
+       pBSSList->byRSSIStatCnt = 0;
+       RFvRSSITodBm(pDevice, (u8) (pRxPacket->uRSSI),
                             &pBSSList->ldBmMAX);
-               pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX;
-               pBSSList->ldBmAverRange = pBSSList->ldBmMAX;
-               for (ii = 1; ii < RSSI_STAT_COUNT; ii++)
-                       pBSSList->ldBmAverage[ii] = 0;
-       }
+       pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX;
+       pBSSList->ldBmAverRange = pBSSList->ldBmMAX;
+       for (ii = 1; ii < RSSI_STAT_COUNT; ii++)
+               pBSSList->ldBmAverage[ii] = 0;
 
        pBSSList->uIELength = uIELength;
        if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN)
@@ -998,10 +996,8 @@ void BSSvSecondCallBack(struct work_struct *work)
 
                if (pMgmt->sNodeDBTable[0].bActive) { /* Assoc with BSS */
 
-                       if (pDevice->bUpdateBBVGA) {
-                               s_vCheckSensitivity(pDevice);
-                               s_vCheckPreEDThreshold(pDevice);
-                       }
+                       s_vCheckSensitivity(pDevice);
+                       s_vCheckPreEDThreshold(pDevice);
 
                        if (pMgmt->sNodeDBTable[0].uInActiveCount >=
                                                        (LOST_BEACON_COUNT/2) &&
@@ -1118,10 +1114,9 @@ void BSSvSecondCallBack(struct work_struct *work)
                }
                if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
 
-                       if (pDevice->bUpdateBBVGA) {
-                               s_vCheckSensitivity(pDevice);
-                               s_vCheckPreEDThreshold(pDevice);
-                       }
+                       s_vCheckSensitivity(pDevice);
+                       s_vCheckPreEDThreshold(pDevice);
+
                        if (pMgmt->sNodeDBTable[0].uInActiveCount >=
                                                ADHOC_LOST_BEACON_COUNT) {
                                DBG_PRT(MSG_LEVEL_NOTICE,
index ee3fb0b6fb77df604e5ee313bbb4bea180d636b9..606ca9fcd3d2b00ad2b3a344ed0cd8568a82c940 100644 (file)
@@ -660,7 +660,6 @@ struct vnt_private {
        int bRxMICFail;
 
        /* For Update BaseBand VGA Gain Offset */
-       int bUpdateBBVGA;
        u32 uBBVGADiffCount;
        u8 byBBVGANew;
        u8 byBBVGACurrent;
index a9d9cc89fc87d82480e624611afdd7a2ea050aff..3a576fa87dbca43ce87bdb4245874cd1685945b1 100644 (file)
@@ -262,7 +262,6 @@ device_set_options(struct vnt_private *pDevice) {
     pDevice->byBBType = BBP_TYPE_DEF;
     pDevice->byPacketType = pDevice->byBBType;
     pDevice->byAutoFBCtrl = AUTO_FB_0;
-    pDevice->bUpdateBBVGA = true;
     pDevice->byPreambleType = 0;
     pDevice->bExistSWNetAddr = false;
     /* pDevice->bDiversityRegCtlON = true; */
@@ -566,12 +565,10 @@ static int device_init_registers(struct vnt_private *pDevice)
        BBvSetShortSlotTime(pDevice);
        CARDvSetBSSMode(pDevice);
 
-       if (pDevice->bUpdateBBVGA) {
-               pDevice->byBBVGACurrent = pDevice->abyBBVGA[0];
-               pDevice->byBBVGANew = pDevice->byBBVGACurrent;
+       pDevice->byBBVGACurrent = pDevice->abyBBVGA[0];
+       pDevice->byBBVGANew = pDevice->byBBVGACurrent;
 
-               BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
-       }
+       BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
 
        pDevice->byRadioCtl = pDevice->abyEEPROM[EEP_OFS_RADIOCTL];
        pDevice->bHWRadioOff = false;
index 8fecb34297afab10181307da96dfa66d9235b6e0..b742460670d399771d307e8dffbbec518c7bf0e4 100644 (file)
@@ -344,11 +344,10 @@ void vRunCommand(struct work_struct *work)
                        CARDbSetMediaChannel(pDevice, pMgmt->uScanChannel);
                        // Set Baseband to be more sensitive.
 
-                       if (pDevice->bUpdateBBVGA) {
-                               BBvSetShortSlotTime(pDevice);
-                               BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
-                               BBvUpdatePreEDThreshold(pDevice, true);
-                       }
+                       BBvSetShortSlotTime(pDevice);
+                       BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
+                       BBvUpdatePreEDThreshold(pDevice, true);
+
                        pMgmt->uScanChannel++;
 
                        while (!ChannelValid(pDevice->byZoneType, pMgmt->uScanChannel) &&
@@ -381,11 +380,9 @@ void vRunCommand(struct work_struct *work)
                        CARDvSetBSSMode(pDevice);
                }
 
-               if (pDevice->bUpdateBBVGA) {
-                       BBvSetShortSlotTime(pDevice);
-                       BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent);
-                       BBvUpdatePreEDThreshold(pDevice, false);
-               }
+               BBvSetShortSlotTime(pDevice);
+               BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent);
+               BBvUpdatePreEDThreshold(pDevice, false);
 
                // Set channel back
                vAdHocBeaconRestart(pDevice);
index d08f290868182656bf17af9641d72afd6b2325ec..e6eec7fc270141c3cf6768901782aacbc2e428c3 100644 (file)
@@ -2653,8 +2653,7 @@ static void s_vMgrSynchBSS(struct vnt_private *pDevice, u32 uBSSMode,
     pMgmt->uCurrChannel = pCurr->uChannel;
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "<----s_bSynchBSS Set Channel [%d]\n", pCurr->uChannel);
 
-    if ((pDevice->bUpdateBBVGA) &&
-        (pDevice->byBBVGACurrent != pDevice->abyBBVGA[0])) {
+    if (pDevice->byBBVGACurrent != pDevice->abyBBVGA[0]) {
         pDevice->byBBVGACurrent = pDevice->abyBBVGA[0];
         BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent);
         BBvSetShortSlotTime(pDevice);