Skip to contentSkip to conversation

Staging: vt6656: Change the define FALSE and TRUE to the lower case variant.

PATCH In review Roel Van Nyen 2 participants 3 messages Jul 12, 2010 – Jul 13, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: vt6656: Change the define FALSE and TRUE to the lower case variant.

Remove the TRUE and FALSE define from the ttype.h

---
 drivers/staging/vt6656/80211mgr.c   |    8 +-
 drivers/staging/vt6656/aes_ccmp.c   |    8 +-
 drivers/staging/vt6656/baseband.c   |   16 +-
 drivers/staging/vt6656/bssdb.c      |  154 ++++++++--------
 drivers/staging/vt6656/card.c       |   60 +++---
 drivers/staging/vt6656/channel.c    |  146 ++++++++--------
 drivers/staging/vt6656/datarate.c   |   18 +-
 drivers/staging/vt6656/device_cfg.h |    8 +-
 drivers/staging/vt6656/dpc.c        |  176 +++++++++---------
 drivers/staging/vt6656/firmware.c   |   16 +-
 drivers/staging/vt6656/hostap.c     |   50 +++---
 drivers/staging/vt6656/int.c        |   12 +-
 drivers/staging/vt6656/ioctl.c      |   68 ++++----
 drivers/staging/vt6656/iwctl.c      |  100 +++++-----
 drivers/staging/vt6656/key.c        |  178 +++++++++---------
 drivers/staging/vt6656/mac.c        |    4 +-
 drivers/staging/vt6656/main_usb.c   |  174 +++++++++---------
 drivers/staging/vt6656/power.c      |   46 +++---
 drivers/staging/vt6656/rf.c         |   30 ++--
 drivers/staging/vt6656/rxtx.c       |  222 +++++++++++-----------
 drivers/staging/vt6656/tether.c     |    6 +-
 drivers/staging/vt6656/ttype.h      |    7 -
 drivers/staging/vt6656/usbpipe.c    |   34 ++--
 drivers/staging/vt6656/wcmd.c       |  170 +++++++++---------
 drivers/staging/vt6656/wctl.c       |   36 ++--
 drivers/staging/vt6656/wmgr.c       |  348 +++++++++++++++++-----------------
 drivers/staging/vt6656/wpa.c        |   26 ++--
 drivers/staging/vt6656/wpa2.c       |   22 +-
 drivers/staging/vt6656/wpactl.c     |   44 +++---
 29 files changed, 1090 insertions(+), 1097 deletions(-)
drivers/staging/vt6656/80211mgr.c +4 -4
index fceec49..c6f4c5d 100644
@@ -178,7 +178,7 @@ vMgrDecodeBeacon(
             break;
         case WLAN_EID_RSN_WPA:
             if (pFrame->pRSNWPA == NULL) {
-                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE)
+                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
                     pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem;
             }
             break;
@@ -402,7 +402,7 @@ vMgrDecodeAssocRequest(
             break;
         case WLAN_EID_RSN_WPA:
             if (pFrame->pRSNWPA == NULL) {
-                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE)
+                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
                     pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem;
             }
             break;
@@ -579,7 +579,7 @@ vMgrDecodeReassocRequest(
             break;
         case WLAN_EID_RSN_WPA:
             if (pFrame->pRSNWPA == NULL) {
-                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE)
+                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
                     pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem;
             }
             break;
@@ -773,7 +773,7 @@ vMgrDecodeProbeResponse(
             break;
         case WLAN_EID_RSN_WPA:
             if (pFrame->pRSNWPA == NULL) {
-                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE)
+                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
                     pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem;
             }
             break;
drivers/staging/vt6656/aes_ccmp.c +4 -4
index f7a3b8f..55ee099 100644
@@ -249,7 +249,7 @@ BOOL AESbGenCCMP(PBYTE pbyRxKey, PBYTE pbyFrame, WORD wFrameSize)
 	WORD            wHLen = 22;
 	/* 8 is IV, 8 is MIC, 4 is CRC */
 	WORD            wPayloadSize = wFrameSize - 8 - 8 - 4 - WLAN_HDR_ADDR3_LEN;
-	BOOL            bA4 = FALSE;
+	BOOL            bA4 = false;
 	BYTE            byTmp;
 	WORD            wCnt;
 	int             ii, jj, kk;
@@ -257,7 +257,7 @@ BOOL AESbGenCCMP(PBYTE pbyRxKey, PBYTE pbyFrame, WORD wFrameSize)
 	pbyIV = pbyFrame + WLAN_HDR_ADDR3_LEN;
 	if (WLAN_GET_FC_TODS(*(PWORD) pbyFrame) &&
 	    WLAN_GET_FC_FROMDS(*(PWORD) pbyFrame)) {
-		bA4 = TRUE;
+		bA4 = true;
 		pbyIV += 6;             /* 6 is 802.11 address4 */
 		wHLen += 6;
 		wPayloadSize -= 6;
@@ -380,7 +380,7 @@ BOOL AESbGenCCMP(PBYTE pbyRxKey, PBYTE pbyFrame, WORD wFrameSize)
 	/* => above is the packet dec-MIC */
 
 	if (!memcmp(abyMIC, abyTmp, 8))
-		return TRUE;
+		return true;
 	else
-		return FALSE;
+		return false;
 }
drivers/staging/vt6656/baseband.c +8 -8
index d3de94f..a64fd25 100644
@@ -775,7 +775,7 @@ BBvCaculateParameter (
     BOOL bCCK = pDevice->bCCK;
 
     cbBitCount = cbFrameLength * 8;
-    bExtBit = FALSE;
+    bExtBit = false;
 
     switch (wRate) {
     case RATE_1M :
@@ -792,7 +792,7 @@ BBvCaculateParameter (
         break;
 
     case RATE_5M :
-        if (bCCK == FALSE)
+        if (bCCK == false)
             cbBitCount ++;
         cbUsCount = (cbBitCount * 10) / 55;
         cbTmp = (cbUsCount * 55) / 10;
@@ -806,14 +806,14 @@ BBvCaculateParameter (
 
     case RATE_11M :
 
-        if (bCCK == FALSE)
+        if (bCCK == false)
             cbBitCount ++;
         cbUsCount = cbBitCount / 11;
         cbTmp = cbUsCount * 11;
         if (cbTmp != cbBitCount) {
             cbUsCount ++;
             if ((cbBitCount - cbTmp) <= 3)
-                bExtBit = TRUE;
+                bExtBit = true;
         }
         if (byPreambleType == 1)
             *pbyPhySgn = 0x0b;
@@ -1006,13 +1006,13 @@ BBbVT3184Init (PSDevice pDevice)
                                   EEP_MAX_CONTEXT_SIZE,
                                   pDevice->abyEEPROM);
     if (ntStatus != STATUS_SUCCESS) {
-        return FALSE;
+        return false;
     }
 
 
     //20080215-01,<Add> by Mike Liu
 //    if ((pDevice->abyEEPROM[EEP_OFS_RADIOCTL]&0x06)==0x04)
-//        return FALSE;
+//        return false;
 
 //20080804-01,<Add> by Mike Liu
 //zonetype initial
@@ -1129,7 +1129,7 @@ else {
         MACvRegBitsOn(pDevice, MAC_REG_SOFTPWRCTL2, SOFTPWRCTL_RFLEOPT);
     //}}
     } else {
-        return TRUE;
+        return true;
     }
 
    memcpy(abyArray, pbyAddr, wLength);
@@ -1168,7 +1168,7 @@ else {
     ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x0D,0x01);
 
     RFbRFTableDownload(pDevice);
-    return TRUE;//ntStatus;
+    return true;//ntStatus;
 }
 
 
drivers/staging/vt6656/bssdb.c +77 -77

524 lines not on this page · raw message

drivers/staging/vt6656/card.c +30 -30

181 lines not on this page · raw message

drivers/staging/vt6656/channel.c +73 -73

221 lines not on this page · raw message

drivers/staging/vt6656/datarate.c +9 -9
index 51dc540..00f4b97 100644
@@ -226,7 +226,7 @@ unsigned int  uRateLen;
     for (ii = 0; ii < uRateLen; ii++) {
     	byRate = (BYTE)(pItemRates->abyRates[ii]);
         if (WLAN_MGMT_IS_BASICRATE(byRate) &&
-            (bUpdateBasicRate == TRUE))  {
+            (bUpdateBasicRate == true))  {
             // Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate
 		CARDbAddBasicRate((void *)pDevice, RATEwGetRateIdx(byRate));
             DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate AddBasicRate: %d\n", RATEwGetRateIdx(byRate));
@@ -312,7 +312,7 @@ PSMgmtObject    pMgmt = &(pDevice->sMgmtObj);
 #if 1  //mike fixed old: use packet lose ratio algorithm to control rate
 WORD            wIdxDownRate = 0;
 unsigned int            ii;
-BOOL            bAutoRate[MAX_RATE]    = {TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE};
+BOOL            bAutoRate[MAX_RATE]    = {true,true,true,true,false,false,true,true,true,true,true,true};
 DWORD           dwThroughputTbl[MAX_RATE] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 540};
 DWORD           dwThroughput = 0;
 WORD            wIdxUpRate = 0;
@@ -339,11 +339,11 @@ DWORD           dwTxDiff = 0;
 
     for (ii = 0; ii < MAX_RATE; ii++) {
         if (psNodeDBTable->wSuppRate & (0x0001<<ii)) {
-            if (bAutoRate[ii] == TRUE) {
+            if (bAutoRate[ii] == true) {
                 wIdxUpRate = (WORD) ii;
             }
         } else {
-            bAutoRate[ii] = FALSE;
+            bAutoRate[ii] = false;
         }
     }
 
@@ -365,7 +365,7 @@ DWORD           dwTxDiff = 0;
     for (ii = psNodeDBTable->wTxDataRate; ii > 0;) {
         ii--;
         if ( (dwThroughputTbl[ii] > dwThroughput) &&
-             (bAutoRate[ii]==TRUE) ) {
+             (bAutoRate[ii]==true) ) {
             dwThroughput = dwThroughputTbl[ii];
             wIdxDownRate = (WORD) ii;
         }
@@ -391,7 +391,7 @@ DWORD           dwTxDiff = 0;
     return;
 #else  //mike fixed new: use differ-signal strength to control rate
 WORD            wIdxUpRate = 0;
-BOOL            bAutoRate[MAX_RATE]    = {TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE};
+BOOL            bAutoRate[MAX_RATE]    = {true,true,true,true,false,false,true,true,true,true,true,true};
 unsigned int            ii;
 long  ldBm;
 
@@ -402,11 +402,11 @@ long  ldBm;
 
     for (ii = 0; ii < MAX_RATE; ii++) {
         if (psNodeDBTable->wSuppRate & (0x0001<<ii)) {
-            if (bAutoRate[ii] == TRUE) {
+            if (bAutoRate[ii] == true) {
                 wIdxUpRate = (WORD) ii;
             }
         } else {
-            bAutoRate[ii] = FALSE;
+            bAutoRate[ii] = false;
         }
     }
 
@@ -435,7 +435,7 @@ if (wIdxUpRate == RATE_54M ) {     //11a/g
 			psNodeDBTable->wTxDataRate = RATE_5M;
 		else {
 			psNodeDBTable->wTxDataRate = RATE_1M;
-			//increasingVGA = TRUE;
+			//increasingVGA = true;
 		}
 	}
 	else {  //11b
drivers/staging/vt6656/device_cfg.h +4 -4
index a0b8216..3be2e87 100644
@@ -38,12 +38,12 @@ struct _version {
     unsigned char   build;
 } version_t, *pversion_t;
 
-#ifndef FALSE
-#define FALSE   (0)
+#ifndef false
+#define false   (0)
 #endif
 
-#ifndef TRUE
-#define TRUE    (!(FALSE))
+#ifndef true
+#define true    (!(false))
 #endif
 
 #define VID_TABLE_SIZE      64
drivers/staging/vt6656/dpc.c +88 -88

573 lines not on this page · raw message

drivers/staging/vt6656/firmware.c +8 -8
index e1f96d7..36826c9 100644
@@ -806,7 +806,7 @@ FIRMWAREbDownload(
                 if (pBuffer)
                     kfree(pBuffer);
                 spin_lock_irq(&pDevice->lock);
-                return (FALSE);
+                return (false);
             }
         }
     }
@@ -815,7 +815,7 @@ FIRMWAREbDownload(
         kfree(pBuffer);
 
     spin_lock_irq(&pDevice->lock);
-    return (TRUE);
+    return (true);
 }
 
 BOOL
@@ -836,9 +836,9 @@ FIRMWAREbBrach2Sram(
                                     );
 
     if (NdisStatus != STATUS_SUCCESS) {
-        return (FALSE);
+        return (false);
     } else {
-        return (TRUE);
+        return (true);
     }
 }
 
@@ -860,17 +860,17 @@ FIRMWAREbCheckVersion(
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Firmware Version [%04x]\n", pDevice->wFirmwareVersion);
     if (ntStatus != STATUS_SUCCESS) {
         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Firmware Invalid.\n");
-        return FALSE;
+        return false;
     }
     if (pDevice->wFirmwareVersion == 0xFFFF) {
         DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"In Loader.\n");
-        return FALSE;
+        return false;
     }
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Firmware Version [%04x]\n", pDevice->wFirmwareVersion);
     if (pDevice->wFirmwareVersion != FIRMWARE_VERSION) {
         // branch to loader for download new firmware
         FIRMWAREbBrach2Sram(pDevice);
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
drivers/staging/vt6656/hostap.c +25 -25

150 lines not on this page · raw message

drivers/staging/vt6656/int.c +6 -6
index 89f5b18..853a4f5 100644
@@ -87,7 +87,7 @@ void INTvWorkItem(void *Context)
 	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Interrupt Polling Thread\n");
 
 	spin_lock_irq(&pDevice->lock);
-	if (pDevice->fKillEventPollingThread != TRUE)
+	if (pDevice->fKillEventPollingThread != true)
 		ntStatus = PIPEnsInterruptRead(pDevice);
 	spin_unlock_irq(&pDevice->lock);
 }
@@ -153,12 +153,12 @@ INTnsProcessData(PSDevice pDevice)
 				if (pMgmt->byDTIMCount > 0) {
 					pMgmt->byDTIMCount--;
 					pMgmt->sNodeDBTable[0].bRxPSPoll =
-						FALSE;
+						false;
 				} else if (pMgmt->byDTIMCount == 0) {
 					/* check if mutltcast tx bufferring */
 					pMgmt->byDTIMCount =
 						pMgmt->byDTIMPeriod-1;
-					pMgmt->sNodeDBTable[0].bRxPSPoll = TRUE;
+					pMgmt->sNodeDBTable[0].bRxPSPoll = true;
 					if (pMgmt->sNodeDBTable[0].bPSEnable)
 						bScheduleCommand((void *) pDevice,
 								 WLAN_CMD_RX_PSPOLL,
@@ -168,9 +168,9 @@ INTnsProcessData(PSDevice pDevice)
 						WLAN_CMD_BECON_SEND,
 						NULL);
 			} /* if (pDevice->eOPMode == OP_MODE_AP) */
-		pDevice->bBeaconSent = TRUE;
+		pDevice->bBeaconSent = true;
 		} else {
-			pDevice->bBeaconSent = FALSE;
+			pDevice->bBeaconSent = false;
 		}
 		if (pINTData->byISR0 & ISR_TBTT) {
 			if (pDevice->bEnablePSMode)
@@ -211,7 +211,7 @@ INTnsProcessData(PSDevice pDevice)
 					WLAN_CMD_RADIO,
 					NULL);
 	pDevice->intBuf.uDataLen = 0;
-	pDevice->intBuf.bInUse = FALSE;
+	pDevice->intBuf.bInUse = false;
 
 	pStats->tx_packets = pDevice->scStatistic.ullTsrOK;
 	pStats->tx_bytes = pDevice->scStatistic.ullTxDirectedBytes +
drivers/staging/vt6656/ioctl.c +34 -34

214 lines not on this page · raw message

drivers/staging/vt6656/iwctl.c +50 -50

262 lines not on this page · raw message

drivers/staging/vt6656/key.c +89 -89

483 lines not on this page · raw message

drivers/staging/vt6656/mac.c +2 -2
index 33698ed..92d9bfb 100644
@@ -133,7 +133,7 @@ void MACvWriteMultiAddr(PSDevice pDevice, unsigned int uByteIdx, BYTE byData)
  *  Out:
  *      none
  *
- * Return Value: TRUE if success; otherwise FALSE
+ * Return Value: true if success; otherwise false
  *
  */
 BOOL MACbShutdown (PSDevice pDevice)
@@ -145,7 +145,7 @@ BOOL MACbShutdown (PSDevice pDevice)
                         0,
                         NULL
                         );
-    return TRUE;
+    return true;
 }
 
 void MACvSetBBType(PSDevice pDevice,BYTE byType)
drivers/staging/vt6656/main_usb.c +87 -87

85 lines not on this page · raw message

drivers/staging/vt6656/power.c +23 -23

46 lines not on this page · raw message

drivers/staging/vt6656/rf.c +15 -15
index 3fd0478..7cc600b 100644

Lines of this file are not shown. View the raw message.

drivers/staging/vt6656/rxtx.c +111 -111

222 lines not on this page · raw message

drivers/staging/vt6656/tether.c +3 -3
index 4f368f1..c268c7b 100644

Lines of this file are not shown. View the raw message.

drivers/staging/vt6656/ttype.h +0 -7
index 3425773..12eea7b 100644

Lines of this file are not shown. View the raw message.

drivers/staging/vt6656/usbpipe.c +17 -17
index 8c7b3af..bfb8be2 100644

Lines of this file are not shown. View the raw message.

drivers/staging/vt6656/wcmd.c +85 -85

170 lines not on this page · raw message

drivers/staging/vt6656/wctl.c +18 -18
index c231ae7..0ece360 100644

Lines of this file are not shown. View the raw message.

drivers/staging/vt6656/wmgr.c +174 -174

348 lines not on this page · raw message

drivers/staging/vt6656/wpa.c +13 -13
index f492778..60f5138 100644

Lines of this file are not shown. View the raw message.

drivers/staging/vt6656/wpa2.c +11 -11
index 6d13190..6ca481f 100644

Lines of this file are not shown. View the raw message.

drivers/staging/vt6656/wpactl.c +22 -22

44 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.0.4

Part of the diff is not shown here. View the raw message.

#1 lore raw

Hi!

On Mon, 2010-07-12 at 23:26 +0200, Roel Van Nyen wrote:
[...]

drivers/staging/vt6656/80211mgr.c vMgrDecodeBeacon( · line 184

Quoted 9 lines
drivers/staging/vt6656/80211mgr.c +1 -1
@@ -178,7 +178,7 @@ vMgrDecodeBeacon(
             break;
         case WLAN_EID_RSN_WPA:
             if (pFrame->pRSNWPA == NULL) {
-                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE)
+                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
                     pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem;
             }
             break;

Am I the only one who thinks that this should better be ---- snip ----
@@ -178,7 +178,7 @@ vMgrDecodeBeacon(

             break;
         case WLAN_EID_RSN_WPA:
             if (pFrame->pRSNWPA == NULL) {
-                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE)
+                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem))
                     pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem;
             }
             break;

---- snip ----
- if only for readability and understandability?

Bernd

Signature · 2 lines
Bernd Petrovitsch                  Email : [email protected]
                     LUGA : http://www.luga.at
#2 lore raw

2010/7/13 Bernd Petrovitsch <[email protected]>

Quoted 29 lines

Hi!

On Mon, 2010-07-12 at 23:26 +0200, Roel Van Nyen wrote:
[...]

Quoted 9 lines
(quoted diff) +0 -0
@@ -178,7 +178,7 @@ vMgrDecodeBeacon(
              break;

         case WLAN_EID_RSN_WPA:
             if (pFrame->pRSNWPA == NULL) {
-                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE)
+                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true) pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem; }
             break;

Am I the only one who thinks that this should better be ----  snip  ----

(quoted diff) +0 -0
@@ -178,7 +178,7 @@ vMgrDecodeBeacon(
             break;

        case WLAN_EID_RSN_WPA:
            if (pFrame->pRSNWPA == NULL) {
-                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE)
+                if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem)) pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem; }
            break;
----  snip  ----
- if only for readability and understandability?

Quoted 5 lines

       Bernd
--
Bernd Petrovitsch                  Email : [email protected] LUGA : http://www.luga.at

Hi!

I think from a readability and understandability standpoint == true is very clear, anyone who reads it will explicitly understand the meaning.
The goal of my patch is to remove the defines from the ttype.h so that at some time ttype.h can be removed.

Any more pros or cons for the == true ?
Roel