Commit 1208f14a authored by Teodora Baluta's avatar Teodora Baluta Committed by Greg Kroah-Hartman
Browse files

staging: vt6655: delete explicit comparison to bool



This patch fixes the following type of coccinelle detected warnings for
driver vt6655:

WARNING: Comparison to bool

Signed-off-by: default avatarTeodora Baluta <teobaluta@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 938db28b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1865,7 +1865,7 @@ BBvCalculateParameter(
		break;

	case RATE_5M:
		if (bCCK == false)
		if (!bCCK)
			cbBitCount++;
		cbUsCount = (cbBitCount * 10) / 55;
		cbTmp = (cbUsCount * 55) / 10;
@@ -1879,7 +1879,7 @@ BBvCalculateParameter(

	case RATE_11M:

		if (bCCK == false)
		if (!bCCK)
			cbBitCount++;
		cbUsCount = cbBitCount / 11;
		cbTmp = cbUsCount * 11;
+4 −4
Original line number Diff line number Diff line
@@ -1053,7 +1053,7 @@ CARDbAdd_PMKID_Candidate(
	for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) {
		pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii];
		if (!memcmp(pCandidateList->BSSID, pbyBSSID, ETH_ALEN)) {
			if ((bRSNCapExist == true) && (wRSNCap & BIT0)) {
			if (bRSNCapExist && (wRSNCap & BIT0)) {
				pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
			} else {
				pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED);
@@ -1064,7 +1064,7 @@ CARDbAdd_PMKID_Candidate(

	// New Candidate
	pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[pDevice->gsPMKIDCandidate.NumCandidates];
	if ((bRSNCapExist == true) && (wRSNCap & BIT0)) {
	if (bRSNCapExist && (wRSNCap & BIT0)) {
		pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
	} else {
		pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED);
@@ -1190,7 +1190,7 @@ CARDbStartMeasure(
		}
	} while (pDevice->uNumOfMeasureEIDs != 0);

	if (bExpired == false) {
	if (!bExpired) {
		MACvSelectPage1(pDevice->PortOffset);
		VNSvOutPortD(pDevice->PortOffset + MAC_REG_MSRSTART, LODWORD(qwStartTSF));
		VNSvOutPortD(pDevice->PortOffset + MAC_REG_MSRSTART + 4, HIDWORD(qwStartTSF));
@@ -1280,7 +1280,7 @@ CARDbSetQuiet(
	PSDevice    pDevice = (PSDevice) pDeviceHandler;
	unsigned int ii = 0;

	if (bResetQuiet == true) {
	if (bResetQuiet) {
		MACvRegBitsOff(pDevice->PortOffset, MAC_REG_MSRCTL, (MSRCTL_QUIETTXCHK | MSRCTL_QUIETEN));
		for (ii = 0; ii < MAX_QUIET_COUNT; ii++) {
			pDevice->sQuiet[ii].bEnable = false;
+8 −8
Original line number Diff line number Diff line
@@ -441,8 +441,8 @@ void init_channel_table(void *pDeviceHandler)
		break;
	}

	if ((pDevice->dwDiagRefCount != 0) || (pDevice->b11hEnable == true)) {
		if (bMultiBand == true) {
	if ((pDevice->dwDiagRefCount != 0) || pDevice->b11hEnable) {
		if (bMultiBand) {
			for (ii = 0; ii < CARD_MAX_CHANNEL_TBL; ii++) {
				sChannelTbl[ii + 1].bValid = true;
				pDevice->abyRegPwr[ii + 1] = pDevice->abyOFDMDefaultPwr[ii + 1];
@@ -463,7 +463,7 @@ void init_channel_table(void *pDeviceHandler)
			}
		}
	} else if (pDevice->byZoneType <= CCODE_MAX) {
		if (bMultiBand == true) {
		if (bMultiBand) {
			for (ii = 0; ii < CARD_MAX_CHANNEL_TBL; ii++) {
				if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) {
					sChannelTbl[ii + 1].bValid = true;
@@ -531,7 +531,7 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
		return bResult;
	}

	if (sChannelTbl[uConnectionChannel].bValid == false) {
	if (!sChannelTbl[uConnectionChannel].bValid) {
		return false;
	}

@@ -557,7 +557,7 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
	bResult &= RFbSelectChannel(pDevice->PortOffset, pDevice->byRFType, (unsigned char)uConnectionChannel);

	// Init Synthesizer Table
	if (pDevice->bEnablePSMode == true)
	if (pDevice->bEnablePSMode)
		RFvWriteWakeProgSyn(pDevice->PortOffset, pDevice->byRFType, uConnectionChannel);

	//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CARDbSetMediaChannel: %d\n", (unsigned char)uConnectionChannel);
@@ -766,7 +766,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)

	if (ePHYType == PHY_TYPE_11A) {
		for (ii = CB_MAX_CHANNEL_24G + 1; ii <= CB_MAX_CHANNEL; ii++) {
			if (sChannelTbl[ii].bValid == true) {
			if (sChannelTbl[ii].bValid) {
				if (byOptionChannel == 0) {
					byOptionChannel = (unsigned char) ii;
				}
@@ -780,7 +780,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
	} else {
		byOptionChannel = 0;
		for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) {
			if (sChannelTbl[ii].bValid == true) {
			if (sChannelTbl[ii].bValid) {
				if (sChannelTbl[ii].byMAP == 0) {
					aiWeight[ii] += 100;
				} else if (sChannelTbl[ii].byMAP & 0x01) {
@@ -807,7 +807,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
			}
		}
		for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) {
			if ((sChannelTbl[ii].bValid == true) &&
			if (sChannelTbl[ii].bValid &&
			    (aiWeight[ii] > aiWeight[byOptionChannel])) {
				byOptionChannel = (unsigned char) ii;
			}
+3 −5
Original line number Diff line number Diff line
@@ -218,8 +218,7 @@ RATEvParseMaxRate(

	for (ii = 0; ii < uRateLen; ii++) {
		byRate = (unsigned char)(pItemRates->abyRates[ii]);
		if (WLAN_MGMT_IS_BASICRATE(byRate) &&
		    (bUpdateBasicRate == true))  {
		if (WLAN_MGMT_IS_BASICRATE(byRate) && bUpdateBasicRate)  {
			// Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate
			CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate));
			DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate));
@@ -329,7 +328,7 @@ RATEvTxRateFallBack(

	for (ii = 0; ii < MAX_RATE; ii++) {
		if (psNodeDBTable->wSuppRate & (0x0001<<ii)) {
			if (bAutoRate[ii] == true) {
			if (bAutoRate[ii]) {
				wIdxUpRate = (unsigned short) ii;
			}
		} else {
@@ -354,8 +353,7 @@ RATEvTxRateFallBack(
	wIdxDownRate = psNodeDBTable->wTxDataRate;
	for (ii = psNodeDBTable->wTxDataRate; ii > 0;) {
		ii--;
		if ((dwThroughputTbl[ii] > dwThroughput) &&
		    (bAutoRate[ii] == true)) {
		if ((dwThroughputTbl[ii] > dwThroughput) && bAutoRate[ii]) {
			dwThroughput = dwThroughputTbl[ii];
			wIdxDownRate = (unsigned short) ii;
		}
+30 −30
Original line number Diff line number Diff line
@@ -561,7 +561,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
			pDevice->byTxAntennaMode = ANT_B;
			pDevice->dwTxAntennaSel = 1;
			pDevice->dwRxAntennaSel = 1;
			if (pDevice->bTxRxAntInv == true)
			if (pDevice->bTxRxAntInv)
				pDevice->byRxAntennaMode = ANT_A;
			else
				pDevice->byRxAntennaMode = ANT_B;
@@ -578,13 +578,13 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
			pDevice->dwRxAntennaSel = 0;
			if (byValue & EEP_ANTENNA_AUX) {
				pDevice->byTxAntennaMode = ANT_A;
				if (pDevice->bTxRxAntInv == true)
				if (pDevice->bTxRxAntInv)
					pDevice->byRxAntennaMode = ANT_B;
				else
					pDevice->byRxAntennaMode = ANT_A;
			} else {
				pDevice->byTxAntennaMode = ANT_B;
				if (pDevice->bTxRxAntInv == true)
				if (pDevice->bTxRxAntInv)
					pDevice->byRxAntennaMode = ANT_A;
				else
					pDevice->byRxAntennaMode = ANT_B;
@@ -635,7 +635,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
		pDevice->byRFType &= RF_MASK;
		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->byRFType = %x\n", pDevice->byRFType);

		if (pDevice->bZoneRegExist == false) {
		if (!pDevice->bZoneRegExist) {
			pDevice->byZoneType = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];
		}
		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->byZoneType = %x\n", pDevice->byZoneType);
@@ -742,7 +742,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
			if (!(pDevice->byGPIO & GPIO0_DATA)) { pDevice->bHWRadioOff = false; }

		}
		if ((pDevice->bRadioControlOff == true)) {
		if (pDevice->bRadioControlOff) {
			CARDbRadioPowerOff(pDevice);
		} else  CARDbRadioPowerOn(pDevice);
#else
@@ -751,7 +751,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
			pDevice->bHWRadioOff = true;
		}
	}
	if ((pDevice->bHWRadioOff == true) || (pDevice->bRadioControlOff == true)) {
	if (pDevice->bHWRadioOff || pDevice->bRadioControlOff) {
		CARDbRadioPowerOff(pDevice);
	}

@@ -809,7 +809,7 @@ static bool device_release_WPADEV(PSDevice pDevice)
	int ii = 0;
	// wait_queue_head_t	Set_wait;
	//send device close to wpa_supplicnat layer
	if (pDevice->bWPADEVUp == true) {
	if (pDevice->bWPADEVUp) {
		wpahdr = (viawget_wpa_header *)pDevice->skb->data;
		wpahdr->type = VIAWGET_DEVICECLOSE_MSG;
		wpahdr->resp_ie_len = 0;
@@ -826,7 +826,7 @@ static bool device_release_WPADEV(PSDevice pDevice)
		//wait release WPADEV
		//    init_waitqueue_head(&Set_wait);
		//    wait_event_timeout(Set_wait, ((pDevice->wpadev==NULL)&&(pDevice->skb == NULL)),5*HZ);    //1s wait
		while ((pDevice->bWPADEVUp == true)) {
		while (pDevice->bWPADEVUp) {
			set_current_state(TASK_UNINTERRUPTIBLE);
			schedule_timeout(HZ / 20);          //wait 50ms
			ii++;
@@ -892,7 +892,7 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
#ifdef	DEBUG
	printk("Before get pci_info memaddr is %x\n", pDevice->memaddr);
#endif
	if (device_get_pci_info(pDevice, pcid) == false) {
	if (!device_get_pci_info(pDevice, pcid)) {
		printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device.\n");
		device_free_info(pDevice);
		return -ENODEV;
@@ -1633,7 +1633,7 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) {
			bFull = true;
			DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " AC0DMA is Full = %d\n", pDevice->iTDUsed[uIdx]);
		}
		if (netif_queue_stopped(pDevice->dev) && (bFull == false)) {
		if (netif_queue_stopped(pDevice->dev) && !bFull) {
			netif_wake_queue(pDevice->dev);
		}
	}
@@ -1798,7 +1798,7 @@ static int device_open(struct net_device *dev) {
	pDevice->byReAssocCount = 0;
	pDevice->bWPADEVUp = false;
	// Patch: if WEP key already set by iwconfig but device not yet open
	if ((pDevice->bEncryptionEnable == true) && (pDevice->bTransmitKey == true)) {
	if (pDevice->bEncryptionEnable && pDevice->bTransmitKey) {
		KeybSetDefaultKey(&(pDevice->sKey),
				  (unsigned long)(pDevice->byKeyIndex | (1 << 31)),
				  pDevice->uKeyLength,
@@ -1895,7 +1895,7 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
		return 0;
	}

	if (pDevice->bStopTx0Pkt == true) {
	if (pDevice->bStopTx0Pkt) {
		dev_kfree_skb_irq(skb);
		spin_unlock_irq(&pDevice->lock);
		return 0;
@@ -1924,7 +1924,7 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI
	SKeyItem        STempKey;
//    unsigned char byKeyIndex = 0;

	if (pDevice->bStopTx0Pkt == true) {
	if (pDevice->bStopTx0Pkt) {
		dev_kfree_skb_irq(skb);
		return false;
	}
@@ -1993,14 +1993,14 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI
	} else if (pDevice->eCurrentPHYType == PHY_TYPE_11A) {
		byPktType = PK_TYPE_11A;
	} else {
		if (pDevice->bProtectMode == true) {
		if (pDevice->bProtectMode) {
			byPktType = PK_TYPE_11GB;
		} else {
			byPktType = PK_TYPE_11GA;
		}
	}

	if (pDevice->bEncryptionEnable == true)
	if (pDevice->bEncryptionEnable)
		bNeedEncryption = true;

	if (pDevice->bEnableHostWEP) {
@@ -2076,7 +2076,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
	bool bNodeExist = false;

	spin_lock_irq(&pDevice->lock);
	if (pDevice->bLinkPass == false) {
	if (!pDevice->bLinkPass) {
		dev_kfree_skb_irq(skb);
		spin_unlock_irq(&pDevice->lock);
		return 0;
@@ -2130,7 +2130,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
			}
		}

		if (bNodeExist == false) {
		if (!bNodeExist) {
			DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "Unknown STA not found in node DB \n");
			dev_kfree_skb_irq(skb);
			spin_unlock_irq(&pDevice->lock);
@@ -2149,7 +2149,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
		cbFrameBodySize += 8;
	}

	if (pDevice->bEncryptionEnable == true) {
	if (pDevice->bEncryptionEnable) {
		bNeedEncryption = true;
		// get Transmit key
		do {
@@ -2196,7 +2196,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {

	if (pDevice->bEnableHostWEP) {
		DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "acdma0: STA index %d\n", uNodeIndex);
		if (pDevice->bEncryptionEnable == true) {
		if (pDevice->bEncryptionEnable) {
			pTransmitKey = &STempKey;
			pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite;
			pTransmitKey->dwKeyIndex = pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex;
@@ -2286,7 +2286,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
	} else if (pDevice->eCurrentPHYType == PHY_TYPE_11A) {
		byPktType = PK_TYPE_11A;
	} else {
		if (pDevice->bProtectMode == true) {
		if (pDevice->bProtectMode) {
			byPktType = PK_TYPE_11GB;
		} else {
			byPktType = PK_TYPE_11GA;
@@ -2297,7 +2297,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
//	printk("FIX RATE:CurrentRate is %d");
//#endif

	if (bNeedEncryption == true) {
	if (bNeedEncryption) {
		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.wType));
		if ((pDevice->sTxEthHeader.wType) == TYPE_PKT_802_1x) {
			bNeedEncryption = false;
@@ -2306,7 +2306,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
				if (pTransmitKey == NULL) {
					DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Don't Find TX KEY\n");
				} else {
					if (bTKIP_UseGTK == true) {
					if (bTKIP_UseGTK) {
						DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "error: KEY is GTK!!~~\n");
					} else {
						DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
@@ -2493,7 +2493,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
				MACvSelectPage0(pDevice->PortOffset);
				//xxxx
				// WCMDbFlushCommandQueue(pDevice->pMgmt, true);
				if (set_channel(pDevice, pDevice->pCurrMeasureEID->sReq.byChannel) == true) {
				if (set_channel(pDevice, pDevice->pCurrMeasureEID->sReq.byChannel)) {
					pDevice->bMeasureInProgress = true;
					MACvSelectPage1(pDevice->PortOffset);
					MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL, MSRCTL_READY);
@@ -2544,12 +2544,12 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
			if (pDevice->dwIsr & ISR_QUIETSTART) {
				do {
					;
				} while (CARDbStartQuiet(pDevice) == false);
				} while (!CARDbStartQuiet(pDevice));
			}
		}

		if (pDevice->dwIsr & ISR_TBTT) {
			if (pDevice->bEnableFirstQuiet == true) {
			if (pDevice->bEnableFirstQuiet) {
				pDevice->byQuietStartCount--;
				if (pDevice->byQuietStartCount == 0) {
					pDevice->bEnableFirstQuiet = false;
@@ -2558,7 +2558,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
					MACvSelectPage0(pDevice->PortOffset);
				}
			}
			if ((pDevice->bChannelSwitch == true) &&
			if (pDevice->bChannelSwitch &&
			    (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE)) {
				pDevice->byChannelSwitchCount--;
				if (pDevice->byChannelSwitchCount == 0) {
@@ -2575,7 +2575,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
			if (pDevice->eOPMode == OP_MODE_ADHOC) {
				//pDevice->bBeaconSent = false;
			} else {
				if ((pDevice->bUpdateBBVGA) && (pDevice->bLinkPass == true) && (pDevice->uCurrRSSI != 0)) {
				if ((pDevice->bUpdateBBVGA) && pDevice->bLinkPass && (pDevice->uCurrRSSI != 0)) {
					long            ldBm;

					RFvRSSITodBm(pDevice, (unsigned char) pDevice->uCurrRSSI, &ldBm);
@@ -2642,7 +2642,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
			}
			pDevice->bBeaconSent = true;

			if (pDevice->bChannelSwitch == true) {
			if (pDevice->bChannelSwitch) {
				pDevice->byChannelSwitchCount--;
				if (pDevice->byChannelSwitchCount == 0) {
					pDevice->bChannelSwitch = false;
@@ -3237,7 +3237,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
			netif_stop_queue(pDevice->dev);
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
			pMgmt->eScanType = WMAC_SCAN_ACTIVE;
			if (pDevice->bWPASuppWextEnabled != true)
			if (!pDevice->bWPASuppWextEnabled)
#endif
				bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
			bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, NULL);
@@ -3373,7 +3373,7 @@ viawget_resume(struct pci_dev *pcid)
		spin_lock_irq(&pDevice->lock);
		MACvRestoreContext(pDevice->PortOffset, pDevice->abyMacContext);
		device_init_registers(pDevice, DEVICE_INIT_DXPL);
		if (pMgmt->sNodeDBTable[0].bActive == true) { // Assoc with BSS
		if (pMgmt->sNodeDBTable[0].bActive) { // Assoc with BSS
			pMgmt->sNodeDBTable[0].bActive = false;
			pDevice->bLinkPass = false;
			if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
Loading