int ii = 0;
int jj = 0;
- if (pbyDesireBSSID != NULL) {
+ if (pbyDesireBSSID) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"BSSpSearchBSSList BSSID[%pM]\n", pbyDesireBSSID);
if (!is_broadcast_ether_addr(pbyDesireBSSID) &&
memcmp(pbyDesireBSSID, ZeroBSSID, 6) != 0)
pbyBSSID = pbyDesireBSSID;
}
- if (pbyDesireSSID != NULL &&
+ if (pbyDesireSSID &&
((PWLAN_IE_SSID) pbyDesireSSID)->len != 0)
pSSID = (PWLAN_IE_SSID) pbyDesireSSID;
- if (pbyBSSID != NULL && pDevice->bRoaming == false) {
+ if (pbyBSSID && pDevice->bRoaming == false) {
/* match BSSID first */
for (ii = 0; ii < MAX_BSS_NUM; ii++) {
pCurrBSS = &(pMgmt->sBSSList[ii]);
if (pCurrBSS->bActive &&
pCurrBSS->bSelected == false &&
ether_addr_equal(pCurrBSS->abyBSSID, pbyBSSID)) {
- if (pSSID != NULL) {
+ if (pSSID) {
/* compare ssid */
if (!memcmp(pSSID->abySSID,
((PWLAN_IE_SSID) pCurrBSS->abySSID)->abySSID,
pCurrBSS->bSelected = false;
if (pCurrBSS->bActive) {
- if (pSSID != NULL &&
+ if (pSSID &&
/* matched SSID */
(memcmp(pSSID->abySSID,
((PWLAN_IE_SSID) pCurrBSS->abySSID)->abySSID,
pCurrBSS->abyBSSID);
jj++;
- if (pSelect == NULL)
+ if (!pSelect)
pSelect = pCurrBSS;
/* compare RSSI, select the strongest signal */
else if (pCurrBSS->uRSSI < pSelect->uRSSI)
pDevice->bSameBSSMaxNum = jj;
- if (pSelect != NULL) {
+ if (pSelect) {
pSelect->bSelected = true;
if (pDevice->bRoaming == false) {
/* Einsn Add @20070907 */
pSuppRates->len = WLAN_RATES_MAXLEN;
memcpy(pBSSList->abySuppRates, pSuppRates, pSuppRates->len + WLAN_IEHDR_LEN);
- if (pExtSuppRates != NULL) {
+ if (pExtSuppRates) {
if (pExtSuppRates->len > WLAN_RATES_MAXLEN)
pExtSuppRates->len = WLAN_RATES_MAXLEN;
memcpy(pBSSList->abyExtSuppRates, pExtSuppRates, pExtSuppRates->len + WLAN_IEHDR_LEN);
WPA_ClearRSN(pBSSList);
- if (pRSNWPA != NULL) {
+ if (pRSNWPA) {
unsigned int uLen = pRSNWPA->len + 2;
if (uLen <= (uIELength -
WPA2_ClearRSN(pBSSList);
- if (pRSN != NULL) {
+ if (pRSN) {
unsigned int uLen = pRSN->len + 2;
if (uLen <= (uIELength -
signed long ldBm, ldBmSum;
bool bParsingQuiet = false;
- if (pBSSList == NULL)
+ if (!pBSSList)
return false;
pBSSList->qwBSSTimestamp = cpu_to_le64(qwTimestamp);
memcpy(pBSSList->abySSID, pSSID, pSSID->len + WLAN_IEHDR_LEN);
memcpy(pBSSList->abySuppRates, pSuppRates, pSuppRates->len + WLAN_IEHDR_LEN);
- if (pExtSuppRates != NULL)
+ if (pExtSuppRates)
memcpy(pBSSList->abyExtSuppRates, pExtSuppRates, pExtSuppRates->len + WLAN_IEHDR_LEN);
else
memset(pBSSList->abyExtSuppRates, 0, WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1);
WPA_ClearRSN(pBSSList); /* mike update */
- if (pRSNWPA != NULL) {
+ if (pRSNWPA) {
unsigned int uLen = pRSNWPA->len + 2;
if (uLen <= (uIELength -
(unsigned int) (u32) ((u8 *) pRSNWPA - pbyIEs))) {
WPA2_ClearRSN(pBSSList); /* mike update */
- if (pRSN != NULL) {
+ if (pRSN) {
unsigned int uLen = pRSN->len + 2;
if (uLen <= (uIELength -
(unsigned int) (u32) ((u8 *) pRSN - pbyIEs))) {
*puNodeIndex = SelectIndex;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Replace inactive node = %d\n", SelectIndex);
/* clear ps buffer */
- if (pMgmt->sNodeDBTable[*puNodeIndex].sTxPSQueue.next != NULL) {
- while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[*puNodeIndex].sTxPSQueue)) != NULL)
+ if (pMgmt->sNodeDBTable[*puNodeIndex].sTxPSQueue.next) {
+ while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[*puNodeIndex].sTxPSQueue)))
dev_kfree_skb(skb);
}
} else {
u8 byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
struct sk_buff *skb;
- while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[uNodeIndex].sTxPSQueue)) != NULL)
+ while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[uNodeIndex].sTxPSQueue)))
dev_kfree_skb(skb);
/* clear context */
memset(&pMgmt->sNodeDBTable[uNodeIndex], 0, sizeof(KnownNodeDB));
for (ii = uStartIndex; ii < (MAX_NODE_NUM + 1); ii++) {
if (pMgmt->sNodeDBTable[ii].bActive) {
/* check if sTxPSQueue has been initial */
- if (pMgmt->sNodeDBTable[ii].sTxPSQueue.next != NULL) {
- while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[ii].sTxPSQueue)) != NULL) {
+ if (pMgmt->sNodeDBTable[ii].sTxPSQueue.next) {
+ while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[ii].sTxPSQueue))) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PS skb != NULL %d\n", ii);
dev_kfree_skb(skb);
}
if (pMgmt->eCurrState == WMAC_STATE_ASSOC ||
(pMgmt->eCurrMode == WMAC_MODE_IBSS_STA && pMgmt->eCurrState == WMAC_STATE_JOINTED)) {
pBSSList = BSSpAddrIsInBSSList(pDevice, pMgmt->abyCurrBSSID, (PWLAN_IE_SSID) pMgmt->abyCurrSSID);
- if (pBSSList != NULL) {
+ if (pBSSList) {
/* Update BB register if RSSI is too strong */
signed long LocalldBmAverage = 0;
signed long uNumofdBm = 0;
if (pMgmt->eCurrState == WMAC_STATE_ASSOC ||
(pMgmt->eCurrMode == WMAC_MODE_IBSS_STA && pMgmt->eCurrState == WMAC_STATE_JOINTED)) {
pBSSList = BSSpAddrIsInBSSList(pDevice, pMgmt->abyCurrBSSID, (PWLAN_IE_SSID) pMgmt->abyCurrSSID);
- if (pBSSList != NULL) {
+ if (pBSSList) {
pDevice->byBBPreEDRSSI = (u8) (~(pBSSList->ldBmAverRange) + 1);
BBvUpdatePreEDThreshold(pDevice, false);
}