qcacld-3.0: mac: Replace explicit comparison to NULL

Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within mac replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I387e08b1ba4d46e6b5ca5cf08ba398a32a3a00d4
CRs-Fixed: 2418392
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index 6ae5d19..dd05028 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -106,7 +106,7 @@
 {
 	uint32_t rate_flags = 0;
 
-	if (sta_ds == NULL) {
+	if (!sta_ds) {
 		pe_err("sta_ds is NULL");
 		return rate_flags;
 	}
@@ -192,7 +192,7 @@
 	struct ht_profile *ht_profile;
 #endif
 	if (result_code == eSIR_SME_SUCCESS) {
-		if (session_entry->beacon != NULL) {
+		if (session_entry->beacon) {
 			sme_join_rsp->beaconLength = session_entry->bcnLen;
 			qdf_mem_copy(sme_join_rsp->frames,
 				session_entry->beacon,
@@ -203,7 +203,7 @@
 			pe_debug("Beacon: %d",
 				sme_join_rsp->beaconLength);
 		}
-		if (session_entry->assocReq != NULL) {
+		if (session_entry->assocReq) {
 			sme_join_rsp->assocReqLength =
 				session_entry->assocReqLen;
 			qdf_mem_copy(sme_join_rsp->frames +
@@ -216,7 +216,7 @@
 			pe_debug("AssocReq: %d",
 				sme_join_rsp->assocReqLength);
 		}
-		if (session_entry->assocRsp != NULL) {
+		if (session_entry->assocRsp) {
 			sme_join_rsp->assocRspLength =
 				session_entry->assocRspLen;
 			qdf_mem_copy(sme_join_rsp->frames +
@@ -228,7 +228,7 @@
 			session_entry->assocRsp = NULL;
 			session_entry->assocRspLen = 0;
 		}
-		if (session_entry->ricData != NULL) {
+		if (session_entry->ricData) {
 			sme_join_rsp->parsedRicRspLen =
 				session_entry->RICDataLen;
 			qdf_mem_copy(sme_join_rsp->frames +
@@ -244,7 +244,7 @@
 				sme_join_rsp->parsedRicRspLen);
 		}
 #ifdef FEATURE_WLAN_ESE
-		if (session_entry->tspecIes != NULL) {
+		if (session_entry->tspecIes) {
 			sme_join_rsp->tspecIeLen =
 				session_entry->tspecLen;
 			qdf_mem_copy(sme_join_rsp->frames +
@@ -318,28 +318,28 @@
 
 		}
 	} else {
-		if (session_entry->beacon != NULL) {
+		if (session_entry->beacon) {
 			qdf_mem_free(session_entry->beacon);
 			session_entry->beacon = NULL;
 			session_entry->bcnLen = 0;
 		}
-		if (session_entry->assocReq != NULL) {
+		if (session_entry->assocReq) {
 			qdf_mem_free(session_entry->assocReq);
 			session_entry->assocReq = NULL;
 			session_entry->assocReqLen = 0;
 		}
-		if (session_entry->assocRsp != NULL) {
+		if (session_entry->assocRsp) {
 			qdf_mem_free(session_entry->assocRsp);
 			session_entry->assocRsp = NULL;
 			session_entry->assocRspLen = 0;
 		}
-		if (session_entry->ricData != NULL) {
+		if (session_entry->ricData) {
 			qdf_mem_free(session_entry->ricData);
 			session_entry->ricData = NULL;
 			session_entry->RICDataLen = 0;
 		}
 #ifdef FEATURE_WLAN_ESE
-		if (session_entry->tspecIes != NULL) {
+		if (session_entry->tspecIes) {
 			qdf_mem_free(session_entry->tspecIes);
 			session_entry->tspecIes = NULL;
 			session_entry->tspecLen = 0;
@@ -407,7 +407,7 @@
 	pe_debug("Sending message: %s with reasonCode: %s",
 		lim_msg_str(msg_type), lim_result_code_str(result_code));
 
-	if (session_entry == NULL) {
+	if (!session_entry) {
 		rsp_len = sizeof(*sme_join_rsp);
 		sme_join_rsp = qdf_mem_malloc(rsp_len);
 		if (!sme_join_rsp)
@@ -438,7 +438,7 @@
 			sta_ds = dph_get_hash_entry(mac_ctx,
 				DPH_STA_HASH_INDEX_PEER,
 				&session_entry->dph.dphHashTable);
-			if (sta_ds == NULL) {
+			if (!sta_ds) {
 				pe_err("Get Self Sta Entry fail");
 			} else {
 				/* Pass the peer's staId */
@@ -508,7 +508,7 @@
 
 	size = sizeof(struct start_bss_rsp);
 
-	if (pe_session == NULL) {
+	if (!pe_session) {
 		pSirSmeRsp = qdf_mem_malloc(size);
 		if (!pSirSmeRsp)
 			return;
@@ -596,13 +596,13 @@
 	pSirSmeRsp->length = size;
 	pSirSmeRsp->sessionId = smesessionId;
 	pSirSmeRsp->statusCode = resultCode;
-	if (pe_session != NULL)
+	if (pe_session)
 		pSirSmeRsp->staId = pe_session->staId;       /* else it will be always zero smeRsp StaID = 0 */
 
 	mmhMsg.type = msgType;
 	mmhMsg.bodyptr = pSirSmeRsp;
 	mmhMsg.bodyval = 0;
-	if (pe_session == NULL) {
+	if (!pe_session) {
 		MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG,
 				 NO_SESSION, mmhMsg.type));
 	} else {
@@ -769,7 +769,7 @@
 
 error:
 	/* Delete the PE session Created */
-	if ((pe_session != NULL) && LIM_IS_STA_ROLE(pe_session))
+	if ((pe_session) && LIM_IS_STA_ROLE(pe_session))
 		pe_delete_session(mac, pe_session);
 
 	if (false == failure)
@@ -1206,7 +1206,7 @@
 	mmhMsg.type = eWNI_SME_SETCONTEXT_RSP;
 	mmhMsg.bodyptr = set_context_rsp;
 	mmhMsg.bodyval = 0;
-	if (NULL == pe_session) {
+	if (!pe_session) {
 		MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG,
 				 NO_SESSION, mmhMsg.type));
 	} else {
@@ -1247,7 +1247,7 @@
 	mmhMsg.type = eWNI_SME_ADDTS_RSP;
 	mmhMsg.bodyptr = rsp;
 	mmhMsg.bodyval = 0;
-	if (NULL == pe_session) {
+	if (!pe_session) {
 		MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG,
 				 NO_SESSION, mmhMsg.type));
 	} else {
@@ -1281,7 +1281,7 @@
 	if (!rsp)
 		return;
 
-	if (pe_session != NULL) {
+	if (pe_session) {
 
 		rsp->aid = delts->aid;
 		qdf_copy_macaddr(&rsp->macaddr, &delts->macaddr);
@@ -1296,7 +1296,7 @@
 	mmhMsg.type = eWNI_SME_DELTS_RSP;
 	mmhMsg.bodyptr = rsp;
 	mmhMsg.bodyval = 0;
-	if (NULL == pe_session) {
+	if (!pe_session) {
 		MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG,
 				 NO_SESSION, mmhMsg.type));
 	} else {
@@ -1383,7 +1383,7 @@
 		pe_find_session_by_sta_id(mac, pPeStats->staId, &sessionId);
 
 	/* Fill the Session Id */
-	if (NULL != pPeSessionEntry) {
+	if (pPeSessionEntry) {
 		/* Fill the Session Id */
 		pPeStats->sessionId = pPeSessionEntry->smeSessionId;
 	}
@@ -1427,7 +1427,7 @@
 	pPeSessionEntry = pe_find_session_by_bssid(mac, pPeStats->bssid.bytes,
 						   &sessionId);
 	/* Fill the Session Id */
-	if (NULL != pPeSessionEntry) {
+	if (pPeSessionEntry) {
 		/* Fill the Session Id */
 		pPeStats->sessionId = pPeSessionEntry->smeSessionId;
 	} else {
@@ -1476,7 +1476,7 @@
 	pNewPeerInd->mesgType = msgType;
 	pNewPeerInd->sessionId = sessionId;
 
-	if (beacon != NULL) {
+	if (beacon) {
 		qdf_mem_copy((void *)((uint8_t *) pNewPeerInd +
 				      sizeof(tSmeIbssPeerInd)), (void *)beacon,
 			     beaconLen);
@@ -1892,7 +1892,7 @@
 
 	pe_session =
 		pe_find_session_by_session_id(mac, pDelBss->sessionId);
-	if (pe_session == NULL) {
+	if (!pe_session) {
 		pe_err("Session Does not exist for given sessionID: %d",
 			pDelBss->sessionId);
 		qdf_mem_free(MsgQ->bodyptr);