Merge v3.13-rc2 into staging-next
[firefly-linux-kernel-4.4.55.git] / drivers / staging / vt6655 / hostap.c
index ab8b2ba6eedd79cdb2146ef0911fc0ae88e7a63a..ca54b793f9f0273413cb7049cd656349de2cfe4b 100644 (file)
@@ -495,11 +495,11 @@ static int hostap_set_encryption(PSDevice pDevice,
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: alg %d \n", param->u.crypt.alg);
 
        if (param->u.crypt.alg == WPA_ALG_NONE) {
-               if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly == true) {
-                       if (KeybRemoveKey(&(pDevice->sKey),
+               if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly) {
+                       if (!KeybRemoveKey(&(pDevice->sKey),
                                          param->sta_addr,
                                          pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex,
-                                         pDevice->PortOffset) == false) {
+                                         pDevice->PortOffset)) {
                                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybRemoveKey fail \n");
                        }
                        pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
@@ -557,7 +557,7 @@ static int hostap_set_encryption(PSDevice pDevice,
                                       (unsigned char *)abyKey,
                                       KEY_CTL_WEP,
                                       pDevice->PortOffset,
-                                      pDevice->byLocalID) == true) {
+                                      pDevice->byLocalID)) {
                                pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
 
                        } else {
@@ -624,7 +624,7 @@ static int hostap_set_encryption(PSDevice pDevice,
                               (unsigned char *)abyKey,
                               byKeyDecMode,
                               pDevice->PortOffset,
-                              pDevice->byLocalID) == true) {
+                              pDevice->byLocalID)) {
                        pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
 
                } else {
@@ -636,7 +636,7 @@ static int hostap_set_encryption(PSDevice pDevice,
 
        }
 
-       if (bKeyTableFull == true) {
+       if (bKeyTableFull) {
                wKeyCtl &= 0x7F00;              // clear all key control filed
                wKeyCtl |= (byKeyDecMode << 4);
                wKeyCtl |= (byKeyDecMode);