Browse Source

qcacld-3.0: sme: 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 sme replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I26dc90bbae78329dd04768a21c63a9ea55c8fdb4
CRs-Fixed: 2418388
Jeff Johnson 6 years ago
parent
commit
038efe7d8f

+ 50 - 50
core/sme/src/common/sme_api.c

@@ -101,7 +101,7 @@ struct mac_context *sme_get_mac_context(void)
 	mac_handle_t mac_handle;
 
 	mac_handle = cds_get_context(QDF_MODULE_ID_SME);
-	if (NULL == mac_handle) {
+	if (!mac_handle) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_FATAL,
 		FL("invalid mac_handle"));
 		return NULL;
@@ -489,7 +489,7 @@ QDF_STATUS sme_ser_handle_active_cmd(struct wlan_serialization_command *cmd)
 	}
 
 	mac_handle = cds_get_context(QDF_MODULE_ID_SME);
-	if (NULL != mac_handle) {
+	if (mac_handle) {
 		mac_ctx = MAC_CONTEXT(mac_handle);
 	} else {
 		sme_err("No mac_handle found");
@@ -550,7 +550,7 @@ QDF_STATUS sme_ser_cmd_callback(struct wlan_serialization_command *cmd,
 	tSmeCmd *sme_cmd;
 
 	mac_handle = cds_get_context(QDF_MODULE_ID_SME);
-	if (mac_handle != NULL) {
+	if (mac_handle) {
 		mac_ctx = MAC_CONTEXT(mac_handle);
 	} else {
 		sme_err("mac_handle is null");
@@ -635,7 +635,7 @@ static void sme_state_info_dump(char **buf_ptr, uint16_t *size)
 	eCsrConnectState connect_state;
 
 	mac_handle = cds_get_context(QDF_MODULE_ID_SME);
-	if (mac_handle == NULL) {
+	if (!mac_handle) {
 		QDF_ASSERT(0);
 		return;
 	}
@@ -793,7 +793,7 @@ QDF_STATUS sme_set11dinfo(mac_handle_t mac_handle,
 
 	MTRACE(qdf_trace(QDF_MODULE_ID_SME,
 			 TRACE_CODE_SME_RX_HDD_MSG_SET_11DINFO, NO_SESSION, 0));
-	if (NULL == pSmeConfigParams) {
+	if (!pSmeConfigParams) {
 		sme_err("SME config params empty");
 		return status;
 	}
@@ -901,7 +901,7 @@ QDF_STATUS sme_update_config(mac_handle_t mac_handle,
 	MTRACE(qdf_trace(QDF_MODULE_ID_SME,
 			 TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CONFIG, NO_SESSION,
 			 0));
-	if (NULL == pSmeConfigParams) {
+	if (!pSmeConfigParams) {
 		sme_err("SME config params empty");
 		return status;
 	}
@@ -1072,7 +1072,7 @@ static void sme_process_ready_to_ext_wow(struct mac_context *mac,
 		return;
 	}
 
-	if (NULL != mac->readyToExtWoWCallback) {
+	if (mac->readyToExtWoWCallback) {
 		mac->readyToExtWoWCallback(mac->readyToExtWoWContext,
 					   indication->status);
 		mac->readyToExtWoWCallback = NULL;
@@ -1136,7 +1136,7 @@ QDF_STATUS sme_get_valid_channels(uint8_t *chan_list, uint32_t *list_len)
 {
 	struct mac_context *mac_ctx = sme_get_mac_context();
 
-	if (NULL == mac_ctx) {
+	if (!mac_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			FL("Invalid MAC context"));
 		return QDF_STATUS_E_FAILURE;
@@ -1380,7 +1380,7 @@ static QDF_STATUS sme_extended_change_channel_ind(struct mac_context *mac_ctx,
 	eCsrRoamResult roam_result;
 
 	ext_chan_ind = msg_buf;
-	if (NULL == ext_chan_ind) {
+	if (!ext_chan_ind) {
 		sme_err("ext_chan_ind is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -1749,7 +1749,7 @@ QDF_STATUS sme_set_ese_roam_scan_channel_list(mac_handle_t mac_handle,
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		return status;
 
-	if (NULL != curchnl_list_info->ChannelList) {
+	if (curchnl_list_info->ChannelList) {
 		for (i = 0; i < curchnl_list_info->numOfChannels; i++) {
 			j += snprintf(oldChannelList + j,
 				sizeof(oldChannelList) - j, "%d",
@@ -1761,7 +1761,7 @@ QDF_STATUS sme_set_ese_roam_scan_channel_list(mac_handle_t mac_handle,
 				pChannelList, numChannels,
 				band);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		if (NULL != curchnl_list_info->ChannelList) {
+		if (curchnl_list_info->ChannelList) {
 			j = 0;
 			for (i = 0; i < curchnl_list_info->numOfChannels; i++) {
 				j += snprintf(newChannelList + j,
@@ -1941,7 +1941,7 @@ QDF_STATUS sme_process_msg(struct mac_context *mac, struct scheduler_msg *pMsg)
 	struct sir_peer_info *peer_stats;
 	struct sir_peer_info_resp *peer_info_rsp;
 
-	if (pMsg == NULL) {
+	if (!pMsg) {
 		sme_err("Empty message for SME");
 		return status;
 	}
@@ -2295,7 +2295,7 @@ QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg)
 {
 	struct mac_context *mac_ctx = cds_get_context(QDF_MODULE_ID_SME);
 
-	if (mac_ctx == NULL) {
+	if (!mac_ctx) {
 		QDF_ASSERT(0);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -2571,7 +2571,7 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
 	tScanResultHandle filtered_scan_result = NULL;
 	tSirBssDescription first_ap_profile;
 
-	if (NULL == mac_ctx) {
+	if (!mac_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 				FL("mac_ctx is NULL"));
 		return QDF_STATUS_E_FAILURE;
@@ -2581,7 +2581,7 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
 		return QDF_STATUS_E_FAILURE;
 
 	qdf_mem_zero(&first_ap_profile, sizeof(tSirBssDescription));
-	if (NULL == profile) {
+	if (!profile) {
 		scan_filter->EncryptionType.numEntries = 1;
 		scan_filter->EncryptionType.encryptionType[0]
 				= eCSR_ENCRYPT_TYPE_NONE;
@@ -2594,7 +2594,7 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
 
 	if (QDF_STATUS_SUCCESS == status) {
 		/* Save the WPS info */
-		if (NULL != profile) {
+		if (profile) {
 			scan_filter->bWPSAssociation =
 						 profile->bWPSAssociation;
 			scan_filter->bOSENAssociation =
@@ -2849,7 +2849,7 @@ QDF_STATUS sme_roam_reassoc(mac_handle_t mac_handle, uint8_t sessionId,
 	status = sme_acquire_global_lock(&mac->sme);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
 		if (CSR_IS_SESSION_VALID(mac, sessionId)) {
-			if ((NULL == pProfile) && (fForce == 1))
+			if ((!pProfile) && (fForce == 1))
 				status = csr_reassoc(mac, sessionId,
 						     &modProfileFields, pRoamId,
 						     fForce);
@@ -2954,7 +2954,7 @@ QDF_STATUS sme_roam_disconnect_sta(mac_handle_t mac_handle, uint8_t sessionId,
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 
-	if (NULL == mac) {
+	if (!mac) {
 		QDF_ASSERT(0);
 		return status;
 	}
@@ -2990,7 +2990,7 @@ QDF_STATUS sme_roam_deauth_sta(mac_handle_t mac_handle, uint8_t sessionId,
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 
-	if (NULL == mac) {
+	if (!mac) {
 		QDF_ASSERT(0);
 		return status;
 	}
@@ -3686,7 +3686,7 @@ QDF_STATUS sme_generic_change_country_code(mac_handle_t mac_handle,
 	struct scheduler_msg msg = {0};
 	tAniGenericChangeCountryCodeReq *pMsg;
 
-	if (NULL == mac) {
+	if (!mac) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_FATAL,
 			  "%s: mac is null", __func__);
 		return status;
@@ -4571,7 +4571,7 @@ QDF_STATUS sme_open_session(mac_handle_t mac_handle,
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
-	if (NULL == pdev) {
+	if (!pdev) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Failed to get pdev handler", __func__);
 		return status;
@@ -4697,7 +4697,7 @@ QDF_STATUS sme_set_keep_alive(mac_handle_t mac_handle, uint8_t session_id,
 	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
 			FL("WMA_SET_KEEP_ALIVE message"));
 
-	if (pSession == NULL) {
+	if (!pSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 				FL("Session not Found"));
 		return QDF_STATUS_E_FAILURE;
@@ -4844,7 +4844,7 @@ QDF_STATUS sme_register_mgmt_frame(mac_handle_t mac_handle, uint8_t sessionId,
 		len = sizeof(*pMsg) + matchLen;
 
 		pMsg = qdf_mem_malloc(len);
-		if (NULL == pMsg)
+		if (!pMsg)
 			status = QDF_STATUS_E_NOMEM;
 		else {
 			pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ;
@@ -4905,7 +4905,7 @@ QDF_STATUS sme_deregister_mgmt_frame(mac_handle_t mac_handle, uint8_t sessionId,
 		len = sizeof(*pMsg) + matchLen;
 
 		pMsg = qdf_mem_malloc(len);
-		if (NULL == pMsg)
+		if (!pMsg)
 			status = QDF_STATUS_E_NOMEM;
 		else {
 			pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ;
@@ -4943,7 +4943,7 @@ static QDF_STATUS sme_prepare_mgmt_tx(mac_handle_t mac_handle,
 
 	msg_len = sizeof(*msg) + len;
 	msg = qdf_mem_malloc(msg_len);
-	if (msg == NULL) {
+	if (!msg) {
 		status = QDF_STATUS_E_NOMEM;
 	} else {
 		msg->type = eWNI_SME_SEND_MGMT_FRAME_TX;
@@ -5261,7 +5261,7 @@ QDF_STATUS sme_get_cfg_valid_channels(uint8_t *aValidChannels,
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct mac_context *mac_ctx = sme_get_mac_context();
 
-	if (NULL == mac_ctx) {
+	if (!mac_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 		FL("Invalid MAC context"));
 		return QDF_STATUS_E_FAILURE;
@@ -7226,7 +7226,7 @@ QDF_STATUS sme_change_roam_scan_channel_list(mac_handle_t mac_handle,
 	}
 	chan_info = &pNeighborRoamInfo->cfgParams.channelInfo;
 
-	if (NULL != chan_info->ChannelList) {
+	if (chan_info->ChannelList) {
 		for (i = 0; i < chan_info->numOfChannels; i++) {
 			if (j < sizeof(oldChannelList))
 				j += snprintf(oldChannelList + j,
@@ -7241,7 +7241,7 @@ QDF_STATUS sme_change_roam_scan_channel_list(mac_handle_t mac_handle,
 	csr_create_bg_scan_roam_channel_list(mac, sessionId, pChannelList,
 			numChannels);
 	sme_set_roam_scan_control(mac_handle, sessionId, 1);
-	if (NULL != chan_info->ChannelList) {
+	if (chan_info->ChannelList) {
 		j = 0;
 		for (i = 0; i < chan_info->numOfChannels; i++) {
 			if (j < sizeof(newChannelList))
@@ -7298,7 +7298,7 @@ QDF_STATUS sme_get_roam_scan_channel_list(mac_handle_t mac_handle,
 	status = sme_acquire_global_lock(&mac->sme);
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		return status;
-	if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) {
+	if (!pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_WARN,
 			FL("Roam Scan channel list is NOT yet initialized"));
 		*pNumChannels = 0;
@@ -7487,7 +7487,7 @@ sme_get_peer_info(mac_handle_t mac_handle,
 
 	status = sme_acquire_global_lock(&mac->sme);
 	if (QDF_STATUS_SUCCESS == status) {
-		if (NULL == callbackfn) {
+		if (!callbackfn) {
 			QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 				"%s: Indication Call back is NULL",
 				__func__);
@@ -7535,7 +7535,7 @@ QDF_STATUS sme_get_peer_info_ext(mac_handle_t mac_handle,
 
 	status = sme_acquire_global_lock(&mac->sme);
 	if (QDF_STATUS_SUCCESS == status) {
-		if (NULL == callbackfn) {
+		if (!callbackfn) {
 			QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 				"%s: Indication Call back is NULL",
 				__func__);
@@ -7993,7 +7993,7 @@ QDF_STATUS sme_notify_modem_power_state(mac_handle_t mac_handle, uint32_t value)
 	tpSirModemPowerStateInd request_buf;
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 
-	if (NULL == mac)
+	if (!mac)
 		return QDF_STATUS_E_FAILURE;
 
 	request_buf = qdf_mem_malloc(sizeof(tSirModemPowerStateInd));
@@ -8029,7 +8029,7 @@ QDF_STATUS sme_notify_ht2040_mode(mac_handle_t mac_handle, uint16_t staId,
 	tUpdateVHTOpMode *pHtOpMode = NULL;
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 
-	if (NULL == mac)
+	if (!mac)
 		return QDF_STATUS_E_FAILURE;
 
 	pHtOpMode = qdf_mem_malloc(sizeof(tUpdateVHTOpMode));
@@ -8143,7 +8143,7 @@ QDF_STATUS sme_set_idle_powersave_config(bool value)
 {
 	void *wmaContext = cds_get_context(QDF_MODULE_ID_WMA);
 
-	if (NULL == wmaContext) {
+	if (!wmaContext) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: wmaContext is NULL", __func__);
 		return QDF_STATUS_E_FAILURE;
@@ -8166,7 +8166,7 @@ int16_t sme_get_ht_config(mac_handle_t mac_handle, uint8_t session_id,
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, session_id);
 
-	if (NULL == pSession) {
+	if (!pSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: pSession is NULL", __func__);
 		return -EIO;
@@ -8195,7 +8195,7 @@ int sme_update_ht_config(mac_handle_t mac_handle, uint8_t sessionId,
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
 
-	if (NULL == pSession) {
+	if (!pSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: pSession is NULL", __func__);
 		return -EIO;
@@ -8627,7 +8627,7 @@ QDF_STATUS sme_set_auto_shutdown_cb(mac_handle_t mac_handle,
 
 	status = sme_acquire_global_lock(&mac->sme);
 	if (QDF_STATUS_SUCCESS == status) {
-		if (NULL != callback_fn)
+		if (callback_fn)
 			mac->sme.auto_shutdown_cb = callback_fn;
 		sme_release_global_lock(&mac->sme);
 	}
@@ -9184,7 +9184,7 @@ QDF_STATUS sme_ap_disable_intra_bss_fwd(mac_handle_t mac_handle,
 
 	/* Prepare the request to send to SME. */
 	pSapDisableIntraFwd = qdf_mem_malloc(sizeof(tDisableIntraBssFwd));
-	if (NULL == pSapDisableIntraFwd) {
+	if (!pSapDisableIntraFwd) {
 		sme_err("Memory Allocation Failure!!!");
 		return QDF_STATUS_E_NOMEM;
 	}
@@ -9502,7 +9502,7 @@ QDF_STATUS sme_update_dsc_pto_up_mapping(mac_handle_t mac_handle,
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		return status;
 	pCsrSession = CSR_GET_SESSION(mac, sessionId);
-	if (pCsrSession == NULL) {
+	if (!pCsrSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 				FL("Session lookup fails for CSR session"));
 		sme_release_global_lock(&mac->sme);
@@ -9519,7 +9519,7 @@ QDF_STATUS sme_update_dsc_pto_up_mapping(mac_handle_t mac_handle,
 				pCsrSession->connectedProfile.bssid.bytes,
 				&peSessionId);
 
-	if (pSession == NULL) {
+	if (!pSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 				FL(" Session lookup fails for BSSID"));
 		sme_release_global_lock(&mac->sme);
@@ -12339,7 +12339,7 @@ QDF_STATUS sme_soc_set_antenna_mode(mac_handle_t mac_handle,
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 	tSmeCmd *cmd;
 
-	if (NULL == msg) {
+	if (!msg) {
 		sme_err("antenna mode mesg is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -12453,7 +12453,7 @@ bool sme_is_session_id_valid(mac_handle_t mac_handle, uint32_t session_id)
 {
 	struct mac_context *mac;
 
-	if (NULL != mac_handle) {
+	if (mac_handle) {
 		mac = MAC_CONTEXT(mac_handle);
 	} else {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
@@ -12863,7 +12863,7 @@ void sme_set_chan_info_callback(mac_handle_t mac_handle,
 {
 	struct mac_context *mac;
 
-	if (mac_handle == NULL) {
+	if (!mac_handle) {
 		QDF_ASSERT(0);
 		return;
 	}
@@ -13135,7 +13135,7 @@ void sme_get_vdev_type_nss(enum QDF_OPMODE dev_mode,
 {
 	struct mac_context *mac_ctx = sme_get_mac_context();
 
-	if (NULL == mac_ctx) {
+	if (!mac_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 		FL("Invalid MAC context"));
 		return;
@@ -13552,7 +13552,7 @@ QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
 	}
 
 	/* update filter to get scan result with just target BSSID */
-	if (NULL == scan_filter->BSSIDs.bssid) {
+	if (!scan_filter->BSSIDs.bssid) {
 		scan_filter->BSSIDs.bssid =
 			qdf_mem_malloc(sizeof(struct qdf_mac_addr));
 		if (!scan_filter->BSSIDs.bssid) {
@@ -13628,7 +13628,7 @@ QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle,
 	}
 
 	/* update filter to get scan result with just target BSSID */
-	if (NULL == scan_filter->BSSIDs.bssid) {
+	if (!scan_filter->BSSIDs.bssid) {
 		scan_filter->BSSIDs.bssid =
 			qdf_mem_malloc(sizeof(struct qdf_mac_addr));
 		if (!scan_filter->BSSIDs.bssid) {
@@ -14217,7 +14217,7 @@ QDF_STATUS sme_get_chain_rssi(mac_handle_t mac_handle,
 
 	SME_ENTER();
 
-	if (NULL == input) {
+	if (!input) {
 		sme_err("Invalid req params");
 		return QDF_STATUS_E_INVAL;
 	}
@@ -14236,7 +14236,7 @@ QDF_STATUS sme_process_msg_callback(struct mac_context *mac,
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
-	if (msg == NULL) {
+	if (!msg) {
 		sme_err("Empty message for SME Msg callback");
 		return status;
 	}
@@ -14586,7 +14586,7 @@ int16_t sme_get_oper_chan_freq(struct wlan_objmgr_vdev *vdev)
 	mac_handle_t mac_handle;
 	int16_t freq = 0;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		sme_err("Invalid vdev id is passed");
 		return 0;
 	}
@@ -14619,7 +14619,7 @@ enum phy_ch_width sme_get_oper_ch_width(struct wlan_objmgr_vdev *vdev)
 	mac_handle_t mac_handle;
 	enum phy_ch_width ch_width = CH_WIDTH_20MHZ;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		sme_err("Invalid vdev id is passed");
 		return CH_WIDTH_INVALID;
 	}

+ 10 - 10
core/sme/src/common/sme_ft_api.c

@@ -29,7 +29,7 @@ void sme_ft_open(mac_handle_t mac_handle, uint32_t sessionId)
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
 
-	if (NULL != pSession) {
+	if (pSession) {
 		/* Clean up the context */
 		qdf_mem_zero(&pSession->ftSmeContext, sizeof(tftSMEContext));
 
@@ -67,7 +67,7 @@ void sme_ft_close(mac_handle_t mac_handle, uint32_t sessionId)
 	sme_ft_reset(mac_handle, sessionId);
 
 	pSession = CSR_GET_SESSION(mac, sessionId);
-	if (NULL != pSession) {
+	if (pSession) {
 		/* check if the timer is running */
 		if (QDF_TIMER_STATE_RUNNING ==
 		    qdf_mc_timer_get_current_state(&pSession->ftSmeContext.
@@ -79,7 +79,7 @@ void sme_ft_close(mac_handle_t mac_handle, uint32_t sessionId)
 		qdf_mc_timer_destroy(&pSession->ftSmeContext.
 					preAuthReassocIntvlTimer);
 
-		if (pSession->ftSmeContext.pUsrCtx != NULL) {
+		if (pSession->ftSmeContext.pUsrCtx) {
 			qdf_mem_free(pSession->ftSmeContext.pUsrCtx);
 			pSession->ftSmeContext.pUsrCtx = NULL;
 		}
@@ -126,7 +126,7 @@ void sme_set_ft_ies(mac_handle_t mac_handle, uint32_t session_id,
 	struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
-	if (NULL == session || NULL == ft_ies) {
+	if (!session || !ft_ies) {
 		sme_err("ft ies or session is NULL");
 		return;
 	}
@@ -359,7 +359,7 @@ QDF_STATUS sme_ft_update_key(mac_handle_t mac_handle, uint32_t sessionId,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (pFTKeyInfo == NULL) {
+	if (!pFTKeyInfo) {
 		sme_err("pFTKeyInfo is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -547,27 +547,27 @@ void sme_ft_reset(mac_handle_t mac_handle, uint32_t sessionId)
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 	struct csr_roam_session *pSession = NULL;
 
-	if (mac == NULL) {
+	if (!mac) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  FL("mac is NULL"));
 		return;
 	}
 
 	pSession = CSR_GET_SESSION(mac, sessionId);
-	if (NULL != pSession) {
-		if (pSession->ftSmeContext.auth_ft_ies != NULL) {
+	if (pSession) {
+		if (pSession->ftSmeContext.auth_ft_ies) {
 			qdf_mem_free(pSession->ftSmeContext.auth_ft_ies);
 			pSession->ftSmeContext.auth_ft_ies = NULL;
 		}
 		pSession->ftSmeContext.auth_ft_ies_length = 0;
 
-		if (pSession->ftSmeContext.reassoc_ft_ies != NULL) {
+		if (pSession->ftSmeContext.reassoc_ft_ies) {
 			qdf_mem_free(pSession->ftSmeContext.reassoc_ft_ies);
 			pSession->ftSmeContext.reassoc_ft_ies = NULL;
 		}
 		pSession->ftSmeContext.reassoc_ft_ies_length = 0;
 
-		if (pSession->ftSmeContext.psavedFTPreAuthRsp != NULL) {
+		if (pSession->ftSmeContext.psavedFTPreAuthRsp) {
 			qdf_mem_free(pSession->ftSmeContext.psavedFTPreAuthRsp);
 			pSession->ftSmeContext.psavedFTPreAuthRsp = NULL;
 		}

+ 2 - 2
core/sme/src/common/sme_power_save.c

@@ -629,7 +629,7 @@ QDF_STATUS sme_set_ps_host_offload(mac_handle_t mac_handle,
 			request->params.hostIpv4Addr[2],
 			request->params.hostIpv4Addr[3]);
 
-	if (NULL == session) {
+	if (!session) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 				"%s: SESSION not Found", __func__);
 		return QDF_STATUS_E_FAILURE;
@@ -680,7 +680,7 @@ QDF_STATUS sme_set_ps_ns_offload(mac_handle_t mac_handle,
 	struct scheduler_msg msg = {0};
 	struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
 
-	if (NULL == session) {
+	if (!session) {
 		sme_err("Session not found");
 		return QDF_STATUS_E_FAILURE;
 	}

+ 116 - 116
core/sme/src/csr/csr_api_roam.c

@@ -1483,7 +1483,7 @@ QDF_STATUS csr_roam_copy_connect_profile(struct mac_context *mac,
 			sizeof(pSession->pConnectBssDesc->length);
 		if (size) {
 			pProfile->pBssDesc = qdf_mem_malloc(size);
-			if (NULL != pProfile->pBssDesc) {
+			if (pProfile->pBssDesc) {
 				qdf_mem_copy(pProfile->pBssDesc,
 					pSession->pConnectBssDesc,
 					size);
@@ -1713,7 +1713,7 @@ QDF_STATUS csr_flush_cfg_bg_scan_roam_channel_list(struct mac_context *mac,
 		&mac->roam.neighborRoamInfo[sessionId];
 
 	/* Free up the memory first (if required) */
-	if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) {
+	if (pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) {
 		qdf_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.
 			     ChannelList);
 		pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL;
@@ -1857,7 +1857,7 @@ QDF_STATUS csr_create_roam_scan_channel_list(struct mac_context *mac,
 	/* Prepare final roam scan channel list */
 	if (outNumChannels) {
 		/* Clear the channel list first */
-		if (NULL != currChannelListInfo->ChannelList) {
+		if (currChannelListInfo->ChannelList) {
 			qdf_mem_free(currChannelListInfo->ChannelList);
 			currChannelListInfo->ChannelList = NULL;
 			currChannelListInfo->numOfChannels = 0;
@@ -1911,7 +1911,7 @@ static void csr_tsm_stats_rsp_processor(struct mac_context *mac, void *pMsg)
 {
 	tAniGetTsmStatsRsp *pTsmStatsRsp = (tAniGetTsmStatsRsp *) pMsg;
 
-	if (NULL != pTsmStatsRsp) {
+	if (pTsmStatsRsp) {
 		/*
 		 * Get roam Rssi request is backed up and passed back
 		 * to the response, Extract the request message
@@ -1920,8 +1920,8 @@ static void csr_tsm_stats_rsp_processor(struct mac_context *mac, void *pMsg)
 		tpAniGetTsmStatsReq reqBkp
 			= (tAniGetTsmStatsReq *) pTsmStatsRsp->tsmStatsReq;
 
-		if (NULL != reqBkp) {
-			if (NULL != reqBkp->tsmStatsCallback) {
+		if (reqBkp) {
+			if (reqBkp->tsmStatsCallback) {
 				((tCsrTsmStatsCallback)
 				 (reqBkp->tsmStatsCallback))(pTsmStatsRsp->
 							     tsmMetrics,
@@ -1934,7 +1934,7 @@ static void csr_tsm_stats_rsp_processor(struct mac_context *mac, void *pMsg)
 			qdf_mem_free(reqBkp);
 			pTsmStatsRsp->tsmStatsReq = NULL;
 		} else {
-			if (NULL != reqBkp) {
+			if (reqBkp) {
 				qdf_mem_free(reqBkp);
 				pTsmStatsRsp->tsmStatsReq = NULL;
 			}
@@ -1959,7 +1959,7 @@ static void csr_send_ese_adjacent_ap_rep_ind(struct mac_context *mac,
 	struct pe_session *pe_session = NULL;
 	uint8_t sessionId = WLAN_UMAC_VDEV_ID_MAX;
 
-	if (NULL == pSession) {
+	if (!pSession) {
 		sme_err("pSession is NULL");
 		return;
 	}
@@ -1976,7 +1976,7 @@ static void csr_send_ese_adjacent_ap_rep_ind(struct mac_context *mac,
 	pe_session = pe_find_session_by_bssid(mac,
 					 pSession->connectedProfile.bssid.bytes,
 					 &sessionId);
-	if (NULL == pe_session) {
+	if (!pe_session) {
 		sme_err("session %d not found", sessionId);
 		qdf_mem_free(roam_info);
 		return;
@@ -2912,7 +2912,7 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din
 	pChanInfo =
 		qdf_mem_malloc(sizeof(tSirMacChanInfo) *
 			       CFG_VALID_CHANNEL_LIST_LEN);
-	if (pChanInfo != NULL) {
+	if (pChanInfo) {
 		pChanInfoStart = pChanInfo;
 		for (index = 0; index < ps11dinfo->Channels.numChannels;
 		     index++) {
@@ -2974,7 +2974,7 @@ QDF_STATUS csr_init_channel_power_list(struct mac_context *mac,
 	pChanInfo =
 		qdf_mem_malloc(sizeof(tSirMacChanInfo) *
 			       CFG_VALID_CHANNEL_LIST_LEN);
-	if (pChanInfo != NULL) {
+	if (pChanInfo) {
 		pChanInfoStart = pChanInfo;
 
 		for (index = 0; index < ps11dinfo->Channels.numChannels;
@@ -3422,7 +3422,7 @@ QDF_STATUS csr_roam_call_callback(struct mac_context *mac, uint32_t sessionId,
 		sme_debug("Assoc complete result: %d status: %d reason: %d",
 			u2, roam_info->statusCode, roam_info->reasonCode);
 		beacon_ies = qdf_mem_malloc(sizeof(tDot11fBeaconIEs));
-		if ((NULL != beacon_ies) && (NULL != roam_info->pBssDesc)) {
+		if ((beacon_ies) && (roam_info->pBssDesc)) {
 			status = csr_parse_bss_description_ies(
 					mac, roam_info->pBssDesc,
 					beacon_ies);
@@ -3483,7 +3483,7 @@ QDF_STATUS csr_roam_call_callback(struct mac_context *mac, uint32_t sessionId,
 	if (eCSR_ROAM_ASSOCIATION_COMPLETION == u1)
 		csr_dump_connection_stats(mac, pSession, roam_info, u1, u2);
 
-	if (NULL != pSession->callback) {
+	if (pSession->callback) {
 		if (roam_info) {
 			roam_info->sessionId = (uint8_t) sessionId;
 			/*
@@ -3515,7 +3515,7 @@ QDF_STATUS csr_roam_call_callback(struct mac_context *mac, uint32_t sessionId,
 		connectionStatus.bssType =
 			roam_info->u.pConnectedProfile->BSSType;
 
-		if (NULL != roam_info->pBssDesc) {
+		if (roam_info->pBssDesc) {
 			connectionStatus.rssi =
 				roam_info->pBssDesc->rssi * (-1);
 			connectionStatus.channel =
@@ -3796,11 +3796,11 @@ QDF_STATUS csr_roam_save_connected_bss_desc(struct mac_context *mac,
 	 * (happens with start IBSS), then nix the BSS description
 	 * that we keep around for the connected BSS) and get out.
 	 */
-	if (NULL == pBssDesc) {
+	if (!pBssDesc) {
 		csr_free_connect_bss_desc(mac, sessionId);
 	} else {
 		size = pBssDesc->length + sizeof(pBssDesc->length);
-		if (NULL != pSession->pConnectBssDesc) {
+		if (pSession->pConnectBssDesc) {
 			if (((pSession->pConnectBssDesc->length) +
 			     sizeof(pSession->pConnectBssDesc->length)) <
 			    size) {
@@ -3810,10 +3810,10 @@ QDF_STATUS csr_roam_save_connected_bss_desc(struct mac_context *mac,
 				csr_free_connect_bss_desc(mac, sessionId);
 			}
 		}
-		if (NULL == pSession->pConnectBssDesc)
+		if (!pSession->pConnectBssDesc)
 			pSession->pConnectBssDesc = qdf_mem_malloc(size);
 
-		if (NULL == pSession->pConnectBssDesc)
+		if (!pSession->pConnectBssDesc)
 			status = QDF_STATUS_E_NOMEM;
 		else
 			qdf_mem_copy(pSession->pConnectBssDesc, pBssDesc, size);
@@ -3831,8 +3831,8 @@ QDF_STATUS csr_roam_prepare_bss_config(struct mac_context *mac,
 	enum csr_cfgdot11mode cfgDot11Mode;
 	uint32_t join_timeout;
 
-	QDF_ASSERT(pIes != NULL);
-	if (pIes == NULL)
+	QDF_ASSERT(pIes);
+	if (!pIes)
 		return QDF_STATUS_E_FAILURE;
 
 	qdf_mem_copy(&pBssConfig->BssCap, &pBssDesc->capabilityInfo,
@@ -4108,7 +4108,7 @@ static QDF_STATUS csr_roam_get_qos_info_from_bss(struct mac_context *mac,
 			status = QDF_STATUS_SUCCESS;
 	} while (0);
 
-	if (NULL != pIes)
+	if (pIes)
 		qdf_mem_free(pIes);
 
 	return status;
@@ -4377,9 +4377,9 @@ static QDF_STATUS csr_get_rate_set(struct mac_context *mac,
 
 	qdf_mem_zero(pOpRateSet, sizeof(tSirMacRateSet));
 	qdf_mem_zero(pExRateSet, sizeof(tSirMacRateSet));
-	QDF_ASSERT(pIes != NULL);
+	QDF_ASSERT(pIes);
 
-	if (NULL == pIes) {
+	if (!pIes) {
 		sme_err("failed to parse BssDesc");
 		return status;
 	}
@@ -4454,8 +4454,8 @@ static void csr_set_cfg_rate_set(struct mac_context *mac, eCsrPhyMode phyMode,
 	uint8_t MCSRateIdxSet[SIZE_OF_SUPPORTED_MCS_SET];
 	qdf_size_t MCSRateLength = 0;
 
-	QDF_ASSERT(pIes != NULL);
-	if (NULL != pIes) {
+	QDF_ASSERT(pIes);
+	if (pIes) {
 		csr_is_phy_mode_match(mac, phyMode, pBssDesc, pProfile,
 				      &cfgDot11Mode, pIes);
 		/* Originally, we thought that for 11a networks, the 11a rates
@@ -4639,7 +4639,7 @@ static void csr_roam_ccm_cfg_set_callback(struct mac_context *mac,
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	struct csr_roam_session *pSession = NULL;
 #endif
-	if (NULL == pEntry) {
+	if (!pEntry) {
 		sme_err("CFG_CNF with active list empty");
 		return;
 	}
@@ -4766,7 +4766,7 @@ QDF_STATUS csr_roam_stop_network(struct mac_context *mac, uint32_t sessionId,
 	}
 
 	pBssConfig = qdf_mem_malloc(sizeof(struct bss_config_param));
-	if (NULL == pBssConfig)
+	if (!pBssConfig)
 		return QDF_STATUS_E_NOMEM;
 
 	sme_debug("session id: %d", sessionId);
@@ -5207,7 +5207,7 @@ static void csr_roam_join_handle_profile(struct mac_context *mac_ctx,
 			cmd->u.roamCmd.roamId, eCSR_ROAM_ASSOCIATION_START,
 			eCSR_ROAM_RESULT_NONE);
 	}
-	if (NULL != cmd->u.roamCmd.pRoamBssEntry) {
+	if (cmd->u.roamCmd.pRoamBssEntry) {
 		/*
 		 * We have BSS
 		 * Need to assign these value because
@@ -5331,10 +5331,10 @@ static enum csr_join_state csr_roam_join_next_bss(struct mac_context *mac_ctx,
 	 * When handling AP's capability change, continue to associate
 	 * to same BSS and make sure pRoamBssEntry is not Null.
 	 */
-	if ((NULL != bss_list) &&
+	if ((bss_list) &&
 		((false == use_same_bss) ||
-		 (cmd->u.roamCmd.pRoamBssEntry == NULL))) {
-		if (cmd->u.roamCmd.pRoamBssEntry == NULL) {
+		 (!cmd->u.roamCmd.pRoamBssEntry))) {
+		if (!cmd->u.roamCmd.pRoamBssEntry) {
 			/* Try the first BSS */
 			cmd->u.roamCmd.pLastRoamBss = NULL;
 			cmd->u.roamCmd.pRoamBssEntry =
@@ -5350,7 +5350,7 @@ static enum csr_join_state csr_roam_join_next_bss(struct mac_context *mac_ctx,
 			 * In this case, will tell HDD the
 			 * completion
 			 */
-			if (NULL == cmd->u.roamCmd.pRoamBssEntry)
+			if (!cmd->u.roamCmd.pRoamBssEntry)
 				goto end;
 			/*
 			 * We need to indicate to HDD that we
@@ -5713,7 +5713,7 @@ QDF_STATUS csr_roam_process_command(struct mac_context *mac, tSmeCmd *pCommand)
 			csr_free_roam_profile(mac, sessionId);
 			pSession->pCurRoamProfile =
 				qdf_mem_malloc(sizeof(struct csr_roam_profile));
-			if (NULL != pSession->pCurRoamProfile) {
+			if (pSession->pCurRoamProfile) {
 				csr_roam_copy_profile(mac,
 					pSession->pCurRoamProfile,
 					&pCommand->u.roamCmd.roamProfile);
@@ -5845,7 +5845,7 @@ static QDF_STATUS csr_roam_save_params(struct mac_context *mac_ctx,
 
 			/* nIeLen doesn't count EID and length fields */
 			session_ptr->pWpaRsnRspIE = qdf_mem_malloc(nIeLen + 2);
-			if (NULL == session_ptr->pWpaRsnRspIE)
+			if (!session_ptr->pWpaRsnRspIE)
 				return QDF_STATUS_E_NOMEM;
 
 			session_ptr->pWpaRsnRspIE[0] = DOT11F_EID_RSN;
@@ -5897,7 +5897,7 @@ static QDF_STATUS csr_roam_save_params(struct mac_context *mac_ctx,
 			 * compiler; nIeLen doesn't count EID & length fields
 			 */
 			session_ptr->pWpaRsnRspIE = qdf_mem_malloc(nIeLen + 2);
-			if (NULL == session_ptr->pWpaRsnRspIE)
+			if (!session_ptr->pWpaRsnRspIE)
 				return QDF_STATUS_E_NOMEM;
 			session_ptr->pWpaRsnRspIE[0] = DOT11F_EID_WPA;
 			session_ptr->pWpaRsnRspIE[1] = (uint8_t) nIeLen;
@@ -5932,7 +5932,7 @@ static QDF_STATUS csr_roam_save_params(struct mac_context *mac_ctx,
 			/* nIeLen doesn't count EID and length fields */
 			session_ptr->pWapiRspIE =
 				qdf_mem_malloc(nIeLen + 2);
-			if (NULL == session_ptr->pWapiRspIE)
+			if (!session_ptr->pWapiRspIE)
 				return QDF_STATUS_E_NOMEM;
 			session_ptr->pWapiRspIE[0] = DOT11F_EID_WAPI;
 			session_ptr->pWapiRspIE[1] = (uint8_t) nIeLen;
@@ -6044,7 +6044,7 @@ bool csr_roam_is_fast_roam_enabled(struct mac_context *mac, uint32_t sessionId)
 
 	if (CSR_IS_SESSION_VALID(mac, sessionId)) {
 		pSession = CSR_GET_SESSION(mac, sessionId);
-		if (NULL != pSession->pCurRoamProfile) {
+		if (pSession->pCurRoamProfile) {
 			if (pSession->pCurRoamProfile->csrPersona !=
 			    QDF_STA_MODE) {
 				return false;
@@ -6901,7 +6901,7 @@ static void csr_roam_process_join_res(struct mac_context *mac_ctx,
 		if (cmd->u.roamCmd.pRoamBssEntry) {
 			scan_res = GET_BASE_ADDR(cmd->u.roamCmd.pRoamBssEntry,
 					struct tag_csrscan_result, Link);
-			if (scan_res != NULL) {
+			if (scan_res) {
 				bss_desc = &scan_res->Result.BssDescriptor;
 				ies_ptr = (tDot11fBeaconIEs *)
 					(scan_res->Result.pvIes);
@@ -7456,7 +7456,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 		size = sizeof(struct qdf_mac_addr) * pSrcProfile->BSSIDs.
 								numOfBSSIDs;
 		pDstProfile->BSSIDs.bssid = qdf_mem_malloc(size);
-		if (NULL == pDstProfile->BSSIDs.bssid) {
+		if (!pDstProfile->BSSIDs.bssid) {
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
@@ -7468,7 +7468,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 	if (pSrcProfile->SSIDs.numOfSSIDs) {
 		size = sizeof(tCsrSSIDInfo) * pSrcProfile->SSIDs.numOfSSIDs;
 		pDstProfile->SSIDs.SSIDList = qdf_mem_malloc(size);
-		if (NULL == pDstProfile->SSIDs.SSIDList) {
+		if (!pDstProfile->SSIDs.SSIDList) {
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
@@ -7480,7 +7480,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 	if (pSrcProfile->nWPAReqIELength) {
 		pDstProfile->pWPAReqIE =
 			qdf_mem_malloc(pSrcProfile->nWPAReqIELength);
-		if (NULL == pDstProfile->pWPAReqIE) {
+		if (!pDstProfile->pWPAReqIE) {
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
@@ -7492,7 +7492,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 	if (pSrcProfile->nRSNReqIELength) {
 		pDstProfile->pRSNReqIE =
 			qdf_mem_malloc(pSrcProfile->nRSNReqIELength);
-		if (NULL == pDstProfile->pRSNReqIE) {
+		if (!pDstProfile->pRSNReqIE) {
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
@@ -7505,7 +7505,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 	if (pSrcProfile->nWAPIReqIELength) {
 		pDstProfile->pWAPIReqIE =
 			qdf_mem_malloc(pSrcProfile->nWAPIReqIELength);
-		if (NULL == pDstProfile->pWAPIReqIE) {
+		if (!pDstProfile->pWAPIReqIE) {
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
@@ -7518,7 +7518,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 	if (pSrcProfile->nAddIEScanLength) {
 		pDstProfile->pAddIEScan =
 			qdf_mem_malloc(pSrcProfile->nAddIEScanLength);
-		if (NULL == pDstProfile->pAddIEScan) {
+		if (!pDstProfile->pAddIEScan) {
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
@@ -7530,7 +7530,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 	if (pSrcProfile->nAddIEAssocLength) {
 		pDstProfile->pAddIEAssoc =
 			qdf_mem_malloc(pSrcProfile->nAddIEAssocLength);
-		if (NULL == pDstProfile->pAddIEAssoc) {
+		if (!pDstProfile->pAddIEAssoc) {
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
@@ -7543,7 +7543,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 		pDstProfile->ChannelInfo.ChannelList =
 			qdf_mem_malloc(pSrcProfile->ChannelInfo.
 					numOfChannels);
-		if (NULL == pDstProfile->ChannelInfo.ChannelList) {
+		if (!pDstProfile->ChannelInfo.ChannelList) {
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
@@ -7690,7 +7690,7 @@ QDF_STATUS csr_roam_copy_connected_profile(struct mac_context *mac,
 			pSrcProfile->nAddIEAssocLength);
 	}
 	pDstProfile->ChannelInfo.ChannelList = qdf_mem_malloc(1);
-	if (NULL == pDstProfile->ChannelInfo.ChannelList) {
+	if (!pDstProfile->ChannelInfo.ChannelList) {
 		status = QDF_STATUS_E_NOMEM;
 		goto end;
 	}
@@ -7739,7 +7739,7 @@ QDF_STATUS csr_roam_issue_connect(struct mac_context *mac, uint32_t sessionId,
 	tSmeCmd *pCommand;
 
 	pCommand = csr_get_command_buffer(mac);
-	if (NULL == pCommand) {
+	if (!pCommand) {
 		csr_scan_result_purge(mac, hBSSList);
 		sme_err(" fail to get command buffer");
 		status = QDF_STATUS_E_RESOURCES;
@@ -7748,7 +7748,7 @@ QDF_STATUS csr_roam_issue_connect(struct mac_context *mac, uint32_t sessionId,
 			csr_scan_abort_mac_scan(mac, sessionId, INVAL_SCAN_ID);
 
 		pCommand->u.roamCmd.fReleaseProfile = false;
-		if (NULL == pProfile) {
+		if (!pProfile) {
 			/* We can roam now
 			 * Since pProfile is NULL, we need to build our own
 			 * profile, set everything to default We can only
@@ -7803,7 +7803,7 @@ QDF_STATUS csr_roam_issue_reassoc(struct mac_context *mac, uint32_t sessionId,
 	tSmeCmd *pCommand;
 
 	pCommand = csr_get_command_buffer(mac);
-	if (NULL == pCommand) {
+	if (!pCommand) {
 		sme_err("fail to get command buffer");
 		status = QDF_STATUS_E_RESOURCES;
 	} else {
@@ -7953,13 +7953,13 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
 	tSirBssDescription *first_ap_profile;
 	uint8_t channel_id = 0;
 
-	if (NULL == pSession) {
+	if (!pSession) {
 		sme_err("session does not exist for given sessionId: %d",
 			sessionId);
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (NULL == pProfile) {
+	if (!pProfile) {
 		sme_err("No profile specified");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -8002,13 +8002,13 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
 			eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
 
 	pScanFilter = qdf_mem_malloc(sizeof(tCsrScanResultFilter));
-	if (NULL == pScanFilter) {
+	if (!pScanFilter) {
 		status = QDF_STATUS_E_NOMEM;
 		goto end;
 	}
 
 	/* Try to connect to any BSS */
-	if (NULL == pProfile) {
+	if (!pProfile) {
 		/* No encryption */
 		pScanFilter->EncryptionType.numEntries = 1;
 		pScanFilter->EncryptionType.encryptionType[0] =
@@ -8027,7 +8027,7 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
 	}
 
 	/*Save the WPS info */
-	if (NULL != pProfile) {
+	if (pProfile) {
 		pScanFilter->bWPSAssociation =
 			pProfile->bWPSAssociation;
 		pScanFilter->bOSENAssociation =
@@ -8109,7 +8109,7 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
 				status);
 			fCallCallback = true;
 		}
-	} else if (NULL != pProfile) {
+	} else if (pProfile) {
 		/* Check whether it is for start ibss */
 		if (CSR_IS_START_IBSS(pProfile) ||
 		    CSR_IS_NDI(pProfile)) {
@@ -8138,7 +8138,7 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
 	}
 
 error:
-	if (NULL != pProfile)
+	if (pProfile)
 		/*
 		 * we need to free memory for filter
 		 * if profile exists
@@ -8178,7 +8178,7 @@ csr_roam_reassoc(struct mac_context *mac_ctx, uint32_t session_id,
 	uint32_t roamId = 0;
 	struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
 
-	if (NULL == profile) {
+	if (!profile) {
 		sme_err("No profile specified");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -8407,7 +8407,7 @@ QDF_STATUS csr_roam_issue_stop_bss_cmd(struct mac_context *mac, uint32_t session
 	tSmeCmd *pCommand;
 
 	pCommand = csr_get_command_buffer(mac);
-	if (NULL != pCommand) {
+	if (pCommand) {
 		/* Change the substate in case it is wait-for-key */
 		if (CSR_IS_WAIT_FOR_KEY(mac, sessionId)) {
 			csr_roam_stop_wait_for_key_timer(mac);
@@ -8488,7 +8488,7 @@ QDF_STATUS csr_roam_save_connected_information(struct mac_context *mac,
 	tCsrRoamConnectedProfile *pConnectProfile = NULL;
 
 	pSession = CSR_GET_SESSION(mac, sessionId);
-	if (NULL == pSession) {
+	if (!pSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			 "session: %d not found", sessionId);
 		return QDF_STATUS_E_FAILURE;
@@ -8551,7 +8551,7 @@ QDF_STATUS csr_roam_save_connected_information(struct mac_context *mac,
 		pConnectProfile->mdid.mobility_domain =
 			(pSirBssDesc->mdie[1] << 8) | (pSirBssDesc->mdie[0]);
 	}
-	if (NULL == pIesTemp)
+	if (!pIesTemp)
 		status = csr_get_parsed_bss_description_ies(mac, pSirBssDesc,
 							   &pIesTemp);
 #ifdef FEATURE_WLAN_ESE
@@ -8598,7 +8598,7 @@ QDF_STATUS csr_roam_save_connected_information(struct mac_context *mac,
 				p_ext_cap->proxy_arp_service;
 		}
 
-		if (NULL == pIes)
+		if (!pIes)
 			/* Free memory if it allocated locally */
 			qdf_mem_free(pIesTemp);
 	}
@@ -8811,7 +8811,7 @@ csr_roam_reissue_roam_command(struct mac_context *mac, uint8_t session_id)
 	struct csr_roam_session *pSession;
 
 	pEntry = csr_nonscan_active_ll_peek_head(mac, LL_ACCESS_LOCK);
-	if (NULL == pEntry) {
+	if (!pEntry) {
 		sme_err("Disassoc rsp can't continue, no active CMD");
 		return;
 	}
@@ -8914,7 +8914,7 @@ csr_roaming_state_config_cnf_processor(struct mac_context *mac_ctx,
 	bool is_ies_malloced = false;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
-	if (NULL == cmd) {
+	if (!cmd) {
 		sme_err("given sme cmd is null");
 		return;
 	}
@@ -8970,9 +8970,9 @@ csr_roaming_state_config_cnf_processor(struct mac_context *mac_ctx,
 		return;
 	}
 
-	if (NULL == scan_result) {
+	if (!scan_result) {
 		/* If we are roaming TO an Infrastructure BSS... */
-		QDF_ASSERT(scan_result != NULL);
+		QDF_ASSERT(scan_result);
 		return;
 	}
 
@@ -9083,7 +9083,7 @@ static void csr_roam_roaming_state_reassoc_rsp_processor(struct mac_context *mac
 			 "CSR SmeReassocReq Successful");
 		result = eCsrReassocSuccess;
 		csr_session = CSR_GET_SESSION(mac, pSmeJoinRsp->sessionId);
-		if (NULL != csr_session) {
+		if (csr_session) {
 			csr_session->supported_nss_1x1 =
 				pSmeJoinRsp->supported_nss_1x1;
 			sme_debug("SME session supported nss: %d",
@@ -9426,7 +9426,7 @@ void csr_roam_roaming_state_disassoc_rsp_processor(struct mac_context *mac,
 		 * connection as well
 		 */
 		pCurRoamProfile = qdf_mem_malloc(sizeof(*pCurRoamProfile));
-		if (pCurRoamProfile != NULL) {
+		if (pCurRoamProfile) {
 			/*
 			 * notify sub-modules like QoS etc. that handoff
 			 * happening
@@ -9646,7 +9646,7 @@ void csr_roaming_state_msg_processor(struct mac_context *mac, void *pMsgBuf)
 	{
 		tAniGetRssiReq *pGetRssiReq = (tAniGetRssiReq *) pMsgBuf;
 
-		if (NULL != pGetRssiReq->rssiCallback)
+		if (pGetRssiReq->rssiCallback)
 			((tCsrRssiCallback) pGetRssiReq->rssiCallback)
 				(pGetRssiReq->lastRSSI, pGetRssiReq->staId,
 				pGetRssiReq->pDevContext);
@@ -10186,7 +10186,7 @@ struct mac_context *mac_ctx, uint32_t session_id,
 #if defined(FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_WAPI)
 	struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
 
-	if (NULL == session) {
+	if (!session) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			 "session %d not found", session_id);
 		return QDF_STATUS_E_FAILURE;
@@ -10247,7 +10247,7 @@ QDF_STATUS csr_roam_send_set_key_cmd(struct mac_context *mac_ctx,
 	WLAN_HOST_DIAG_EVENT_DEF(setKeyEvent,
 				 host_event_wlan_security_payload_type);
 
-	if (NULL == session) {
+	if (!session) {
 		sme_err("session %d not found", session_id);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -10430,7 +10430,7 @@ csr_roam_prepare_filter_from_profile(struct mac_context *mac_ctx,
 		size = sizeof(struct qdf_mac_addr) * profile->BSSIDs.
 							numOfBSSIDs;
 		scan_fltr->BSSIDs.bssid = qdf_mem_malloc(size);
-		if (NULL == scan_fltr->BSSIDs.bssid) {
+		if (!scan_fltr->BSSIDs.bssid) {
 			status = QDF_STATUS_E_NOMEM;
 			goto free_filter;
 		}
@@ -10451,7 +10451,7 @@ csr_roam_prepare_filter_from_profile(struct mac_context *mac_ctx,
 			size = sizeof(tCsrSSIDInfo) *
 				scan_fltr->SSIDs.numOfSSIDs;
 			scan_fltr->SSIDs.SSIDList = qdf_mem_malloc(size);
-			if (NULL == scan_fltr->SSIDs.SSIDList)
+			if (!scan_fltr->SSIDs.SSIDList)
 				status = QDF_STATUS_E_FAILURE;
 			else
 				status = QDF_STATUS_SUCCESS;
@@ -10474,7 +10474,7 @@ csr_roam_prepare_filter_from_profile(struct mac_context *mac_ctx,
 			size = sizeof(tCsrSSIDInfo) *
 				profile->SSIDs.numOfSSIDs;
 			scan_fltr->SSIDs.SSIDList = qdf_mem_malloc(size);
-			if (NULL == scan_fltr->SSIDs.SSIDList) {
+			if (!scan_fltr->SSIDs.SSIDList) {
 				status = QDF_STATUS_E_NOMEM;
 				goto free_filter;
 			}
@@ -10492,7 +10492,7 @@ csr_roam_prepare_filter_from_profile(struct mac_context *mac_ctx,
 		fltr_ch_info->ChannelList =
 			qdf_mem_malloc(sizeof(*(fltr_ch_info->ChannelList)) *
 				       profile_ch_info->numOfChannels);
-		if (NULL == fltr_ch_info->ChannelList) {
+		if (!fltr_ch_info->ChannelList) {
 			status = QDF_STATUS_E_NOMEM;
 			goto free_filter;
 		}
@@ -10652,7 +10652,7 @@ static void csr_update_rssi(struct mac_context *mac, void *pMsg)
 	if (pGetRssiReq) {
 		qdf_status = csr_send_snr_request(pGetRssiReq);
 
-		if (NULL != pGetRssiReq->rssiCallback) {
+		if (pGetRssiReq->rssiCallback) {
 			if (qdf_status != QDF_STATUS_E_BUSY)
 				((tCsrRssiCallback) (pGetRssiReq->rssiCallback))
 					(rssi, pGetRssiReq->staId,
@@ -10692,7 +10692,7 @@ static QDF_STATUS csr_send_reset_ap_caps_changed(struct mac_context *mac,
 	/* Create the message and send to lim */
 	len = sizeof(tSirResetAPCapsChange);
 	pMsg = qdf_mem_malloc(len);
-	if (NULL == pMsg)
+	if (!pMsg)
 		status = QDF_STATUS_E_NOMEM;
 	else
 		status = QDF_STATUS_SUCCESS;
@@ -11854,7 +11854,7 @@ csr_roam_chk_lnk_ibss_peer_departed_ind(struct mac_context *mac_ctx,
 	struct csr_roam_info *roam_info;
 	tSmeIbssPeerInd *pIbssPeerInd;
 
-	if (NULL == msg_ptr) {
+	if (!msg_ptr) {
 		sme_err("IBSS peer ind. message is NULL");
 		return;
 	}
@@ -12068,7 +12068,7 @@ csr_roam_chk_lnk_max_assoc_exceeded(struct mac_context *mac_ctx, tSirSmeRsp *msg
 void csr_roam_check_for_link_status_change(struct mac_context *mac,
 						tSirSmeRsp *pSirMsg)
 {
-	if (NULL == pSirMsg) {
+	if (!pSirMsg) {
 		sme_err("pSirMsg is NULL");
 		return;
 	}
@@ -12349,7 +12349,7 @@ void csr_roam_wait_for_key_time_out_handler(void *pv)
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, session_id);
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
-	if (pSession == NULL) {
+	if (!pSession) {
 		sme_err("session not found");
 		return;
 	}
@@ -13073,7 +13073,7 @@ int8_t csr_get_cfg_max_tx_power(struct mac_context *mac, uint8_t channel)
 	}
 
 error:
-	if (NULL != pCountryInfo)
+	if (pCountryInfo)
 		qdf_mem_free(pCountryInfo);
 
 	return maxTxPwr;
@@ -13231,7 +13231,7 @@ bool csr_is_same_profile(struct mac_context *mac,
 	if (!(pProfile1 && pProfile2))
 		return fCheck;
 	pScanFilter = qdf_mem_malloc(sizeof(tCsrScanResultFilter));
-	if (NULL == pScanFilter)
+	if (!pScanFilter)
 		return fCheck;
 
 	status = csr_roam_prepare_filter_from_profile(mac, pProfile2,
@@ -13976,7 +13976,7 @@ static QDF_STATUS csr_roam_start_ibss(struct mac_context *mac, uint32_t sessionI
 		struct bss_config_param *pBssConfig;
 
 		pBssConfig = qdf_mem_malloc(sizeof(struct bss_config_param));
-		if (NULL == pBssConfig)
+		if (!pBssConfig)
 			status = QDF_STATUS_E_NOMEM;
 		else
 			status = QDF_STATUS_SUCCESS;
@@ -14430,7 +14430,7 @@ static QDF_STATUS csr_roam_start_wds(struct mac_context *mac, uint32_t sessionId
 			csr_free_roam_profile(mac, sessionId);
 			pSession->pCurRoamProfile =
 				qdf_mem_malloc(sizeof(struct csr_roam_profile));
-			if (pSession->pCurRoamProfile != NULL) {
+			if (pSession->pCurRoamProfile) {
 				csr_roam_copy_profile(mac,
 						      pSession->pCurRoamProfile,
 						      pProfile);
@@ -14865,7 +14865,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 		return QDF_STATUS_E_FAILURE;
 	}
 	/* To satisfy klockworks */
-	if (NULL == pBssDescription) {
+	if (!pBssDescription) {
 		sme_err(" pBssDescription is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -14904,7 +14904,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 				sizeof(tCsrWpaIe) + sizeof(tCsrWpaAuthIe) +
 				sizeof(uint16_t);
 		csr_join_req = qdf_mem_malloc(msgLen);
-		if (NULL == csr_join_req)
+		if (!csr_join_req)
 			status = QDF_STATUS_E_NOMEM;
 		else
 			status = QDF_STATUS_SUCCESS;
@@ -14912,7 +14912,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 			break;
 
 		wpaRsnIE = qdf_mem_malloc(DOT11F_IE_RSN_MAX_LEN);
-		if (NULL == wpaRsnIE)
+		if (!wpaRsnIE)
 			status = QDF_STATUS_E_NOMEM;
 
 		if (!QDF_IS_STATUS_SUCCESS(status))
@@ -15176,7 +15176,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 					}
 					pSession->pWapiReqIE =
 						qdf_mem_malloc(ieLen);
-					if (NULL == pSession->pWapiReqIE)
+					if (!pSession->pWapiReqIE)
 						status = QDF_STATUS_E_NOMEM;
 					else
 						status = QDF_STATUS_SUCCESS;
@@ -15201,7 +15201,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 					}
 					pSession->pWpaRsnReqIE =
 						qdf_mem_malloc(ieLen);
-					if (NULL == pSession->pWpaRsnReqIE)
+					if (!pSession->pWpaRsnReqIE)
 						status = QDF_STATUS_E_NOMEM;
 					else
 						status = QDF_STATUS_SUCCESS;
@@ -15269,7 +15269,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 					qdf_mem_free(pSession->pAddIEScan);
 				}
 				pSession->pAddIEScan = qdf_mem_malloc(ieLen);
-				if (NULL == pSession->pAddIEScan)
+				if (!pSession->pAddIEScan)
 					status = QDF_STATUS_E_NOMEM;
 				else
 					status = QDF_STATUS_SUCCESS;
@@ -15299,7 +15299,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 					qdf_mem_free(pSession->pAddIEAssoc);
 				}
 				pSession->pAddIEAssoc = qdf_mem_malloc(ieLen);
-				if (NULL == pSession->pAddIEAssoc)
+				if (!pSession->pAddIEAssoc)
 					status = QDF_STATUS_E_NOMEM;
 				else
 					status = QDF_STATUS_SUCCESS;
@@ -15324,7 +15324,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 		if (eWNI_SME_REASSOC_REQ == messageType) {
 			/* Unmask any AC in reassoc that is ACM-set */
 			uapsd_mask = (uint8_t) pProfile->uapsd_mask;
-			if (uapsd_mask && (NULL != pBssDescription)) {
+			if (uapsd_mask && (pBssDescription)) {
 				if (CSR_IS_QOS_BSS(pIes)
 						&& CSR_IS_UAPSD_BSS(pIes))
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
@@ -15717,7 +15717,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 	} while (0);
 
 	/* Clean up the memory in case of any failure */
-	if (!QDF_IS_STATUS_SUCCESS(status) && (NULL != csr_join_req))
+	if (!QDF_IS_STATUS_SUCCESS(status) && (csr_join_req))
 		qdf_mem_free(csr_join_req);
 
 	if (wpaRsnIE)
@@ -15738,13 +15738,13 @@ QDF_STATUS csr_send_mb_disassoc_req_msg(struct mac_context *mac,
 		return QDF_STATUS_E_FAILURE;
 
 	pMsg = qdf_mem_malloc(sizeof(*pMsg));
-	if (NULL == pMsg)
+	if (!pMsg)
 		return QDF_STATUS_E_NOMEM;
 
 	pMsg->messageType = eWNI_SME_DISASSOC_REQ;
 	pMsg->length = sizeof(*pMsg);
 	pMsg->sessionId = sessionId;
-	if ((pSession->pCurRoamProfile != NULL)
+	if ((pSession->pCurRoamProfile)
 		&& (CSR_IS_INFRA_AP(pSession->pCurRoamProfile))) {
 		qdf_mem_copy(&pMsg->bssid.bytes,
 			     &pSession->selfMacAddr,
@@ -15804,7 +15804,7 @@ QDF_STATUS csr_send_chng_mcc_beacon_interval(struct mac_context *mac,
 	/* Create the message and send to lim */
 	len = sizeof(*pMsg);
 	pMsg = qdf_mem_malloc(len);
-	if (NULL == pMsg)
+	if (!pMsg)
 		status = QDF_STATUS_E_NOMEM;
 	else
 		status = QDF_STATUS_SUCCESS;
@@ -15845,7 +15845,7 @@ QDF_STATUS csr_set_ht2040_mode(struct mac_context *mac, uint32_t sessionId,
 	/* Create the message and send to lim */
 	len = sizeof(struct set_ht2040_mode);
 	pMsg = qdf_mem_malloc(len);
-	if (NULL == pMsg)
+	if (!pMsg)
 		status = QDF_STATUS_E_NOMEM;
 	else
 		status = QDF_STATUS_SUCCESS;
@@ -15887,7 +15887,7 @@ QDF_STATUS csr_send_mb_deauth_req_msg(struct mac_context *mac,
 	pMsg->length = sizeof(*pMsg);
 	pMsg->sessionId = sessionId;
 
-	if ((pSession->pCurRoamProfile != NULL)
+	if ((pSession->pCurRoamProfile)
 	     && (CSR_IS_INFRA_AP(pSession->pCurRoamProfile))) {
 		qdf_mem_copy(&pMsg->bssid,
 			     &pSession->selfMacAddr,
@@ -15916,7 +15916,7 @@ QDF_STATUS csr_send_mb_disassoc_cnf_msg(struct mac_context *mac,
 
 	do {
 		pMsg = qdf_mem_malloc(sizeof(*pMsg));
-		if (NULL == pMsg)
+		if (!pMsg)
 			status = QDF_STATUS_E_NOMEM;
 		else
 			status = QDF_STATUS_SUCCESS;
@@ -15954,7 +15954,7 @@ QDF_STATUS csr_send_mb_deauth_cnf_msg(struct mac_context *mac,
 
 	do {
 		pMsg = qdf_mem_malloc(sizeof(*pMsg));
-		if (NULL == pMsg)
+		if (!pMsg)
 			status = QDF_STATUS_E_NOMEM;
 		else
 			status = QDF_STATUS_SUCCESS;
@@ -16061,7 +16061,7 @@ QDF_STATUS csr_send_mb_set_context_req_msg(struct mac_context *mac,
 		msgLen = sizeof(*pMsg);
 
 		pMsg = qdf_mem_malloc(msgLen);
-		if (NULL == pMsg)
+		if (!pMsg)
 			return QDF_STATUS_E_NOMEM;
 		pMsg->messageType = eWNI_SME_SETCONTEXT_REQ;
 		pMsg->length = msgLen;
@@ -16125,7 +16125,7 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, uint32_t
 	pSession->joinFailStatusCode.statusCode = eSIR_SME_SUCCESS;
 	pSession->joinFailStatusCode.reasonCode = 0;
 	pMsg = qdf_mem_malloc(sizeof(*pMsg));
-	if (NULL == pMsg)
+	if (!pMsg)
 		return QDF_STATUS_E_NOMEM;
 
 	pMsg->messageType = eWNI_SME_START_BSS_REQ;
@@ -16254,7 +16254,7 @@ QDF_STATUS csr_send_mb_stop_bss_req_msg(struct mac_context *mac,
 	}
 
 	pMsg = qdf_mem_malloc(sizeof(*pMsg));
-	if (NULL == pMsg)
+	if (!pMsg)
 		return QDF_STATUS_E_NOMEM;
 	pMsg->messageType = eWNI_SME_STOP_BSS_REQ;
 	pMsg->sessionId = sessionId;
@@ -16321,7 +16321,7 @@ QDF_STATUS csr_process_add_sta_session_rsp(struct mac_context *mac, uint8_t *pMs
 	struct send_extcap_ie *msg;
 	QDF_STATUS status;
 
-	if (pMsg == NULL) {
+	if (!pMsg) {
 		sme_err("in %s msg ptr is NULL", __func__);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -16627,7 +16627,7 @@ QDF_STATUS csr_process_del_sta_session_rsp(struct mac_context *mac_ctx,
 	tListElem *entry;
 	tSmeCmd *sme_command;
 
-	if (pMsg == NULL) {
+	if (!pMsg) {
 		sme_err("msg ptr is NULL");
 		return status;
 	}
@@ -16688,7 +16688,7 @@ csr_issue_del_sta_for_session_req(struct mac_context *mac_ctx, uint32_t session_
 	tSmeCmd *sme_command;
 
 	sme_command = csr_get_command_buffer(mac_ctx);
-	if (NULL == sme_command) {
+	if (!sme_command) {
 		status = QDF_STATUS_E_RESOURCES;
 	} else {
 		sme_command->command = e_sme_command_del_sta_session;
@@ -17188,7 +17188,7 @@ struct csr_statsclient_reqinfo *csr_roam_insert_entry_into_list(
 	 * if same entity requested for same set of stats with different
 	 * callback update it
 	 */
-	if (NULL == csr_roam_checkn_update_client_req_list(mac, pStaEntry,
+	if (!csr_roam_checkn_update_client_req_list(mac, pStaEntry,
 								true)) {
 
 	pNewStaEntry = qdf_mem_malloc(sizeof(struct csr_statsclient_reqinfo));
@@ -17230,7 +17230,7 @@ QDF_STATUS csr_get_rssi(struct mac_context *mac,
 	}
 
 	pMsg = qdf_mem_malloc(sizeof(tAniGetRssiReq));
-	if (NULL == pMsg) {
+	if (!pMsg) {
 		return QDF_STATUS_E_NOMEM;
 	}
 
@@ -17324,7 +17324,7 @@ csr_deregister_client_request(struct mac_context *mac_ctx,
 	/* clean up & return */
 	ptr_sta_entry = GET_BASE_ADDR(entry,
 				      struct csr_statsclient_reqinfo, link);
-	if (NULL != ptr_sta_entry->pPeStaEntry) {
+	if (ptr_sta_entry->pPeStaEntry) {
 		ptr_sta_entry->pPeStaEntry->numClient--;
 		/* check if we need to delete the entry from peStatsReqList */
 		if (!ptr_sta_entry->pPeStaEntry->numClient)
@@ -19040,7 +19040,7 @@ csr_roam_offload_scan(struct mac_context *mac_ctx, uint8_t session_id,
 
 	sme_debug("RSO Command %d, Session id %d, Reason %d", command,
 		   session_id, reason);
-	if (NULL == session) {
+	if (!session) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			 "session is null");
 		return QDF_STATUS_E_FAILURE;
@@ -19389,7 +19389,7 @@ struct mac_context *mac, struct csr_pestats_reqinfo *pPeStaEntry)
 	while (pEntry) {
 		pTempStaEntry = GET_BASE_ADDR(pEntry,
 				struct csr_pestats_reqinfo, link);
-		if (NULL == pTempStaEntry
+		if (!pTempStaEntry
 			|| (pTempStaEntry->statsMask !=
 				pPeStaEntry->statsMask)) {
 			pEntry = csr_ll_next(&mac->roam.peStatsReqList, pEntry,
@@ -19914,7 +19914,7 @@ QDF_STATUS csr_roam_update_config(struct mac_context *mac_ctx, uint8_t session_i
 	struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
 
 	sme_debug("update HT config requested");
-	if (NULL == session) {
+	if (!session) {
 		sme_err("Session does not exist for session id %d", session_id);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -19958,7 +19958,7 @@ bool csr_roam_is_sta_mode(struct mac_context *mac, uint32_t sessionId)
 	 * really in STA Mode.
 	 */
 
-	if (NULL != pSession->pCurRoamProfile) {
+	if (pSession->pCurRoamProfile) {
 		if (pSession->pCurRoamProfile->csrPersona == QDF_STA_MODE)
 			return true;
 		else
@@ -19978,7 +19978,7 @@ QDF_STATUS csr_handoff_request(struct mac_context *mac,
 	tAniHandoffReq *pMsg;
 
 	pMsg = qdf_mem_malloc(sizeof(tAniHandoffReq));
-	if (NULL == pMsg) {
+	if (!pMsg) {
 		return QDF_STATUS_E_NOMEM;
 	}
 	pMsg->msgType = eWNI_SME_HANDOFF_REQ;
@@ -20236,7 +20236,7 @@ QDF_STATUS csr_send_ext_change_channel(struct mac_context *mac_ctx, uint32_t cha
 	struct sir_sme_ext_cng_chan_req *msg;
 
 	msg = qdf_mem_malloc(sizeof(*msg));
-	if (NULL == msg)
+	if (!msg)
 		return QDF_STATUS_E_NOMEM;
 
 	msg->message_type = eWNI_SME_EXT_CHANGE_CHANNEL;
@@ -21311,7 +21311,7 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	if (len) {
 		session->connectedInfo.pbFrames =
 			qdf_mem_malloc(len);
-		if (session->connectedInfo.pbFrames != NULL) {
+		if (session->connectedInfo.pbFrames) {
 			qdf_mem_copy(session->connectedInfo.pbFrames,
 				roam_synch_data->join_rsp->frames, len);
 			session->connectedInfo.nRICRspLength =

+ 15 - 15
core/sme/src/csr/csr_api_scan.c

@@ -70,7 +70,7 @@ static bool csr_roam_is_valid_channel(struct mac_context *mac, uint8_t channel);
 void csr_free_scan_result_entry(struct mac_context *mac,
 				struct tag_csrscan_result *pResult)
 {
-	if (NULL != pResult->Result.pvIes)
+	if (pResult->Result.pvIes)
 		qdf_mem_free(pResult->Result.pvIes);
 
 	qdf_mem_free(pResult);
@@ -148,10 +148,10 @@ QDF_STATUS csr_scan_handle_search_for_ssid(struct mac_context *mac_ctx,
 			sme_warn("aborts because roam command waiting");
 			break;
 		}
-		if (profile == NULL)
+		if (!profile)
 			break;
 		pScanFilter = qdf_mem_malloc(sizeof(tCsrScanResultFilter));
-		if (NULL == pScanFilter) {
+		if (!pScanFilter) {
 			status = QDF_STATUS_E_NOMEM;
 			break;
 		}
@@ -272,7 +272,7 @@ QDF_STATUS csr_scan_handle_search_for_ssid_failure(struct mac_context *mac_ctx,
 		return status;
 	}
 	roam_result = eCSR_ROAM_RESULT_FAILURE;
-	if (NULL != profile && csr_is_bss_type_ibss(profile->BSSType)) {
+	if (profile && csr_is_bss_type_ibss(profile->BSSType)) {
 		roam_result = eCSR_ROAM_RESULT_IBSS_START_FAILED;
 		goto roam_completion;
 	}
@@ -536,7 +536,7 @@ QDF_STATUS csr_save_to_channel_power2_g_5_g(struct mac_context *mac,
 	/* atleast 3 bytes have to be remaining  -- from "countryString" */
 	while (i--) {
 	pChannelSet = qdf_mem_malloc(sizeof(struct csr_channel_powerinfo));
-		if (NULL == pChannelSet) {
+		if (!pChannelSet) {
 			pChannelInfo++;
 			continue;
 		}
@@ -843,7 +843,7 @@ void csr_save_channel_power_for_band(struct mac_context *mac, bool fill_5f)
 
 	chan_info = qdf_mem_malloc(sizeof(tSirMacChanInfo) *
 				   CFG_VALID_CHANNEL_LIST_LEN);
-	if (NULL == chan_info)
+	if (!chan_info)
 		return;
 
 	ch_info_start = chan_info;
@@ -906,7 +906,7 @@ bool csr_learn_11dcountry_information(struct mac_context *mac,
 	tDot11fBeaconIEs *pIesLocal = pIes;
 	bool useVoting = false;
 
-	if ((NULL == pSirBssDesc) && (NULL == pIes))
+	if ((!pSirBssDesc) && (!pIes))
 		useVoting = true;
 
 	/* check if .11d support is enabled */
@@ -1314,7 +1314,7 @@ tCsrScanResultInfo *csr_scan_result_get_next(struct mac_context *mac,
 	if (!pResultList)
 		return NULL;
 
-	if (NULL == pResultList->pCurEntry)
+	if (!pResultList->pCurEntry)
 		pEntry = csr_ll_peek_head(&pResultList->List, LL_ACCESS_NOLOCK);
 	else
 		pEntry = csr_ll_next(&pResultList->List, pResultList->pCurEntry,
@@ -1412,7 +1412,7 @@ QDF_STATUS csr_scan_for_ssid(struct mac_context *mac_ctx, uint32_t session_id,
 		req->scan_req.extraie.ptr =
 			qdf_mem_malloc(profile->nAddIEScanLength);
 
-		if (NULL == req->scan_req.extraie.ptr)
+		if (!req->scan_req.extraie.ptr)
 			status = QDF_STATUS_E_NOMEM;
 		else
 			status = QDF_STATUS_SUCCESS;
@@ -1785,7 +1785,7 @@ QDF_STATUS csr_scan_create_entry_in_scan_cache(struct mac_context *mac,
 	tSirBssDescription *pNewBssDescriptor = NULL;
 	uint32_t size = 0;
 
-	if (NULL == pSession) {
+	if (!pSession) {
 		return QDF_STATUS_E_FAILURE;
 	}
 	sme_debug("Current bssid::"MAC_ADDRESS_STR,
@@ -1878,7 +1878,7 @@ csr_get_fst_bssdescr_ptr(tScanResultHandle result_handle)
 	struct scan_result_list *bss_list =
 				(struct scan_result_list *)result_handle;
 
-	if (NULL == bss_list) {
+	if (!bss_list) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			FL("Empty bss_list"));
 		return NULL;
@@ -1889,7 +1889,7 @@ csr_get_fst_bssdescr_ptr(tScanResultHandle result_handle)
 		return NULL;
 	}
 	first_element = csr_ll_peek_head(&bss_list->List, LL_ACCESS_NOLOCK);
-	if (NULL == first_element) {
+	if (!first_element) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			FL("peer head return NULL"));
 		return NULL;
@@ -1919,7 +1919,7 @@ csr_get_bssdescr_from_scan_handle(tScanResultHandle result_handle,
 	struct scan_result_list *bss_list =
 				(struct scan_result_list *)result_handle;
 
-	if (NULL == bss_list) {
+	if (!bss_list) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 				FL("Empty bss_list"));
 		return NULL;
@@ -1953,7 +1953,7 @@ csr_get_channel_for_hw_mode_change(struct mac_context *mac_ctx,
 				(struct scan_result_list *)result_handle;
 	uint8_t channel_id = 0;
 
-	if (NULL == bss_list) {
+	if (!bss_list) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  FL("Empty bss_list"));
 		goto end;
@@ -3075,7 +3075,7 @@ void csr_init_occupied_channels_list(struct mac_context *mac_ctx,
 		 * Free the memory allocated for pIes in
 		 * csr_get_parsed_bss_description_ies
 		 */
-		if ((bss_desc->Result.pvIes == NULL) && ie_ptr)
+		if ((!bss_desc->Result.pvIes) && ie_ptr)
 			qdf_mem_free(ie_ptr);
 		scan_entry = csr_ll_next(&scan_list->List, scan_entry,
 				     LL_ACCESS_NOLOCK);

+ 1 - 1
core/sme/src/csr/csr_cmd_process.c

@@ -98,7 +98,7 @@ QDF_STATUS csr_msg_processor(struct mac_context *mac_ctx, void *msg_buf)
 				sme_rsp->messageType) {
 			tAniGetRssiReq *pGetRssiReq =
 				(tAniGetRssiReq *) msg_buf;
-			if (NULL == pGetRssiReq->rssiCallback) {
+			if (!pGetRssiReq->rssiCallback) {
 				sme_err("rssiCallback is NULL");
 				return status;
 			}

+ 8 - 8
core/sme/src/csr/csr_host_scan_roam.c

@@ -96,7 +96,7 @@ QDF_STATUS csr_roam_issue_reassociate_cmd(struct mac_context *mac,
 				pCommand = NULL;
 		}
 	}
-	if (NULL == pCommand) {
+	if (!pCommand) {
 		sme_err("fail to get cmd buf based on prev roam command");
 		return QDF_STATUS_E_RESOURCES;
 	}
@@ -108,7 +108,7 @@ QDF_STATUS csr_roam_issue_reassociate_cmd(struct mac_context *mac,
 		 * csr_reinit_roam_cmd when releasing the current command.
 		 */
 		tmp_command = csr_get_command_buffer(mac);
-		if (tmp_command == NULL) {
+		if (!tmp_command) {
 			sme_err("fail to get cmd buf!");
 			csr_release_command(mac, pCommand);
 			return QDF_STATUS_E_RESOURCES;
@@ -197,7 +197,7 @@ void csr_neighbor_roam_process_scan_results(struct mac_context *mac_ctx,
 
 			scan_result = csr_scan_result_get_next(
 						mac_ctx, *scan_results_list);
-			if (NULL == scan_result)
+			if (!scan_result)
 				break;
 			descr = &scan_result->BssDescriptor;
 			QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
@@ -329,7 +329,7 @@ void csr_neighbor_roam_process_scan_results(struct mac_context *mac_ctx,
 			bss_info->pBssDescription =
 				qdf_mem_malloc(descr->length +
 					sizeof(descr->length));
-			if (bss_info->pBssDescription != NULL) {
+			if (bss_info->pBssDescription) {
 				qdf_mem_copy(bss_info->pBssDescription, descr,
 					descr->length + sizeof(descr->length));
 			} else {
@@ -578,7 +578,7 @@ tpCsrNeighborRoamBSSInfo csr_neighbor_roam_next_roamable_ap(
 	tpCsrNeighborRoamBSSInfo result = NULL;
 
 	if (llist) {
-		if (NULL == neighbor_entry)
+		if (!neighbor_entry)
 			entry = csr_ll_peek_head(llist, LL_ACCESS_LOCK);
 		else
 			entry = csr_ll_next(llist, &neighbor_entry->List,
@@ -715,8 +715,8 @@ bool csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac,
 		&mac->roam.neighborRoamInfo[session_id];
 	tpCsrNeighborRoamBSSInfo bss_node = NULL;
 
-	if (NULL == hand_off_node) {
-		QDF_ASSERT(NULL != hand_off_node);
+	if (!hand_off_node) {
+		QDF_ASSERT(hand_off_node);
 		return false;
 	}
 	if (ngbr_roam_info->is11rAssoc) {
@@ -758,7 +758,7 @@ bool csr_neighbor_roam_get_handoff_ap_info(struct mac_context *mac,
 		sme_debug("Number of Handoff candidates: %d",
 			csr_ll_count(&ngbr_roam_info->roamableAPList));
 	}
-	if (NULL == bss_node)
+	if (!bss_node)
 		return false;
 	qdf_mem_copy(hand_off_node, bss_node, sizeof(tCsrNeighborRoamBSSInfo));
 	return true;

+ 14 - 14
core/sme/src/csr/csr_neighbor_roam.c

@@ -168,7 +168,7 @@ QDF_STATUS csr_neighbor_roam_update_config(struct mac_context *mac_ctx,
 	eCsrNeighborRoamState state;
 	uint8_t old_value;
 
-	if (NULL == pNeighborRoamInfo) {
+	if (!pNeighborRoamInfo) {
 		sme_err("Invalid Session ID %d", session_id);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -349,8 +349,8 @@ csr_neighbor_roam_prepare_scan_profile_filter(struct mac_context *mac,
 	struct roam_ext_params *roam_params;
 	uint8_t num_ch = 0;
 
-	QDF_ASSERT(pScanFilter != NULL);
-	if (pScanFilter == NULL)
+	QDF_ASSERT(pScanFilter);
+	if (!pScanFilter)
 		return QDF_STATUS_E_FAILURE;
 
 	qdf_mem_zero(pScanFilter, sizeof(tCsrScanResultFilter));
@@ -810,7 +810,7 @@ QDF_STATUS csr_neighbor_roam_indicate_disconnect(struct mac_context *mac,
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
 	struct csr_roam_session *roam_session = NULL;
 
-	if (NULL == pSession) {
+	if (!pSession) {
 		sme_err("pSession is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -831,9 +831,9 @@ QDF_STATUS csr_neighbor_roam_indicate_disconnect(struct mac_context *mac,
 	 */
 	if (!csr_neighbor_middle_of_roaming(mac, sessionId))
 		csr_roam_reset_roam_params(mac);
-	if (NULL != pSession) {
+	if (pSession) {
 		roam_session = &mac->roam.roamSession[sessionId];
-		if (NULL != pSession->pCurRoamProfile && (QDF_STA_MODE !=
+		if (pSession->pCurRoamProfile && (QDF_STA_MODE !=
 			roam_session->pCurRoamProfile->csrPersona)) {
 			sme_err("Ignore disconn ind rcvd from nonSTA persona sessionId: %d csrPersonna %d",
 				sessionId,
@@ -1025,7 +1025,7 @@ static void csr_neighbor_roam_info_ctx_init(
 		ngbr_roam_info->uOsRequestedHandoff = 0;
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 		if (session->roam_synch_in_progress) {
-			if (mac->roam.pReassocResp != NULL) {
+			if (mac->roam.pReassocResp) {
 				QDF_TRACE(QDF_MODULE_ID_SME,
 					QDF_TRACE_LEVEL_DEBUG,
 					"Free Reassoc Rsp");
@@ -1075,8 +1075,8 @@ QDF_STATUS csr_neighbor_roam_indicate_connect(
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	/* if session id invalid then we need return failure */
-	if (NULL == ngbr_roam_info || !CSR_IS_SESSION_VALID(mac, session_id)
-	|| (NULL == mac->roam.roamSession[session_id].pCurRoamProfile)) {
+	if (!ngbr_roam_info || !CSR_IS_SESSION_VALID(mac, session_id)
+	|| (!mac->roam.roamSession[session_id].pCurRoamProfile)) {
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -1442,7 +1442,7 @@ static QDF_STATUS csr_neighbor_roam_process_handoff_req(
 	tCsrScanResultFilter    scan_filter;
 	tScanResultHandle       scan_result;
 
-	if (NULL == session) {
+	if (!session) {
 		sme_err("session is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -1461,7 +1461,7 @@ static QDF_STATUS csr_neighbor_roam_process_handoff_req(
 	}
 	/* Add the BSSID & Channel */
 	profile->BSSIDs.numOfBSSIDs = 1;
-	if (NULL == profile->BSSIDs.bssid) {
+	if (!profile->BSSIDs.bssid) {
 		profile->BSSIDs.bssid =
 			qdf_mem_malloc(sizeof(tSirMacAddr) *
 				profile->BSSIDs.numOfBSSIDs);
@@ -1478,7 +1478,7 @@ static QDF_STATUS csr_neighbor_roam_process_handoff_req(
 	}
 
 	profile->ChannelInfo.numOfChannels = 1;
-	if (NULL == profile->ChannelInfo.ChannelList) {
+	if (!profile->ChannelInfo.ChannelList) {
 		profile->ChannelInfo.ChannelList =
 			qdf_mem_malloc(sizeof(*profile->
 				ChannelInfo.ChannelList) *
@@ -1522,7 +1522,7 @@ static QDF_STATUS csr_neighbor_roam_process_handoff_req(
 	}
 
 end:
-	if (NULL != profile) {
+	if (profile) {
 		csr_release_profile(mac_ctx, profile);
 		qdf_mem_free(profile);
 	}
@@ -1614,7 +1614,7 @@ QDF_STATUS csr_neighbor_roam_handoff_req_hdlr(
 
 	/* save the handoff info came from HDD as part of the reassoc req */
 	handoff_req = (tAniHandoffReq *) msg;
-	if (NULL == handoff_req) {
+	if (!handoff_req) {
 		sme_err("Received msg is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}

+ 7 - 7
core/sme/src/csr/csr_roam_preauth.c

@@ -110,7 +110,7 @@ QDF_STATUS csr_roam_enqueue_preauth(struct mac_context *mac_ctx,
 	tSmeCmd *command;
 
 	command = csr_get_command_buffer(mac_ctx);
-	if (NULL == command) {
+	if (!command) {
 		sme_err("fail to get command buffer");
 		status = QDF_STATUS_E_RESOURCES;
 	} else {
@@ -238,7 +238,7 @@ QDF_STATUS csr_neighbor_roam_preauth_rsp_handler(struct mac_context *mac_ctx,
 			csr_neighbor_roam_next_roamable_ap(
 				mac_ctx, &neighbor_roam_info->roamableAPList,
 				NULL);
-	if ((QDF_STATUS_SUCCESS == lim_status) && (NULL != preauth_rsp_node)) {
+	if ((QDF_STATUS_SUCCESS == lim_status) && (preauth_rsp_node)) {
 		sme_debug("Preauth completed successfully after %d tries",
 			neighbor_roam_info->FTRoamInfo.numPreAuthRetries);
 		sme_debug("After Pre-Auth: BSSID " MAC_ADDRESS_STR ", Ch:%d",
@@ -471,7 +471,7 @@ static uint32_t csr_get_dot11_mode(struct mac_context *mac_ctx,
 		sme_err("csr_get_parsed_bss_description_ies failed");
 		return 0;
 	}
-	if (ies_local == NULL) {
+	if (!ies_local) {
 		sme_err("ies_local is NULL");
 		return 0;
 	}
@@ -517,7 +517,7 @@ QDF_STATUS csr_roam_issue_ft_preauth_req(struct mac_context *mac_ctx,
 	struct csr_roam_session *csr_session = CSR_GET_SESSION(mac_ctx,
 				session_id);
 
-	if (NULL == csr_session) {
+	if (!csr_session) {
 		sme_err("Session does not exist for session id: %d",
 			session_id);
 		return QDF_STATUS_E_FAILURE;
@@ -588,7 +588,7 @@ void csr_roam_ft_pre_auth_rsp_processor(struct mac_context *mac_ctx,
 				session_id);
 	tDot11fAuthentication *p_auth = NULL;
 
-	if (NULL == csr_session) {
+	if (!csr_session) {
 		sme_err("CSR session is NULL");
 		return;
 	}
@@ -683,7 +683,7 @@ void csr_roam_ft_pre_auth_rsp_processor(struct mac_context *mac_ctx,
 		p_auth = (tDot11fAuthentication *) qdf_mem_malloc(
 						sizeof(tDot11fAuthentication));
 
-		if (p_auth == NULL)
+		if (!p_auth)
 			return;
 
 		status = dot11f_unpack_authentication(mac_ctx,
@@ -750,7 +750,7 @@ QDF_STATUS csr_neighbor_roam_issue_preauth_req(struct mac_context *mac_ctx,
 	neighbor_bss_node = csr_neighbor_roam_next_roamable_ap(mac_ctx,
 				&neighbor_roam_info->roamableAPList, NULL);
 
-	if (NULL == neighbor_bss_node) {
+	if (!neighbor_bss_node) {
 		sme_err("Roamable AP list is empty");
 		return QDF_STATUS_E_FAILURE;
 	}

+ 14 - 14
core/sme/src/csr/csr_util.c

@@ -700,7 +700,7 @@ bool csr_is_session_client_and_connected(struct mac_context *mac, uint8_t sessio
 	if (CSR_IS_SESSION_VALID(mac, sessionId)
 	    && csr_is_conn_state_infra(mac, sessionId)) {
 		pSession = CSR_GET_SESSION(mac, sessionId);
-		if (NULL != pSession->pCurRoamProfile) {
+		if (pSession->pCurRoamProfile) {
 			if ((pSession->pCurRoamProfile->csrPersona ==
 			     QDF_STA_MODE)
 			    || (pSession->pCurRoamProfile->csrPersona ==
@@ -721,7 +721,7 @@ uint8_t csr_get_concurrent_operation_channel(struct mac_context *mac_ctx)
 		if (!CSR_IS_SESSION_VALID(mac_ctx, i))
 			continue;
 		session = CSR_GET_SESSION(mac_ctx, i);
-		if (NULL == session->pCurRoamProfile)
+		if (!session->pCurRoamProfile)
 			continue;
 		persona = session->pCurRoamProfile->csrPersona;
 		if ((((persona == QDF_STA_MODE) ||
@@ -751,7 +751,7 @@ uint8_t csr_get_beaconing_concurrent_channel(struct mac_context *mac_ctx,
 		if (!CSR_IS_SESSION_VALID(mac_ctx, i))
 			continue;
 		session = CSR_GET_SESSION(mac_ctx, i);
-		if (NULL == session->pCurRoamProfile)
+		if (!session->pCurRoamProfile)
 			continue;
 		persona = session->pCurRoamProfile->csrPersona;
 		if (((persona == QDF_P2P_GO_MODE) ||
@@ -1022,7 +1022,7 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx,
 			continue;
 
 		session = CSR_GET_SESSION(mac_ctx, i);
-		if (NULL == session->pCurRoamProfile)
+		if (!session->pCurRoamProfile)
 			continue;
 		if (((session->pCurRoamProfile->csrPersona == QDF_STA_MODE) ||
 			(session->pCurRoamProfile->csrPersona ==
@@ -1225,7 +1225,7 @@ bool csr_is_valid_mc_concurrent_session(struct mac_context *mac_ctx,
 		return false;
 	/* Validate BeaconInterval */
 	pSession = CSR_GET_SESSION(mac_ctx, session_id);
-	if (NULL == pSession->pCurRoamProfile)
+	if (!pSession->pCurRoamProfile)
 		return false;
 	if (QDF_STATUS_SUCCESS == csr_validate_mcc_beacon_interval(mac_ctx,
 					bss_descr->channelId,
@@ -1305,7 +1305,7 @@ bool csr_is_ssid_equal(struct mac_context *mac,
 	tDot11fBeaconIEs *pIesLocal = pIes2;
 
 	do {
-		if ((NULL == pSirBssDesc1) || (NULL == pSirBssDesc2))
+		if ((!pSirBssDesc1) || (!pSirBssDesc2))
 			break;
 		if (!pIesLocal
 		    &&
@@ -1351,7 +1351,7 @@ static bool csr_is_bss_description_wme(struct mac_context *mac,
 	tDot11fBeaconIEs *pIesTemp = pIes;
 
 	do {
-		if (pIesTemp == NULL) {
+		if (!pIesTemp) {
 			if (!QDF_IS_STATUS_SUCCESS
 				    (csr_get_parsed_bss_description_ies
 					    (mac, pSirBssDesc, &pIesTemp))) {
@@ -1369,7 +1369,7 @@ static bool csr_is_bss_description_wme(struct mac_context *mac,
 		if (!pIesTemp->HTCaps.present)
 			fWme = false;
 
-	if ((pIes == NULL) && (NULL != pIesTemp))
+	if ((!pIes) && (pIesTemp))
 		/* we allocate memory here so free it before returning */
 		qdf_mem_free(pIesTemp);
 
@@ -1382,8 +1382,8 @@ eCsrMediaAccessType csr_get_qos_from_bss_desc(struct mac_context *mac_ctx,
 {
 	eCsrMediaAccessType qosType = eCSR_MEDIUM_ACCESS_DCF;
 
-	if (NULL == pIes) {
-		QDF_ASSERT(pIes != NULL);
+	if (!pIes) {
+		QDF_ASSERT(pIes);
 		return qosType;
 	}
 
@@ -6055,9 +6055,9 @@ bool csr_is_set_key_allowed(struct mac_context *mac, uint32_t sessionId)
 	 * what the state is.
 	 */
 	sme_debug("is not what it intends to. Must be revisit or removed");
-	if ((NULL == pSession)
+	if ((!pSession)
 	    || (csr_is_conn_state_disconnected(mac, sessionId)
-		&& (pSession->pCurRoamProfile != NULL)
+		&& (pSession->pCurRoamProfile)
 		&& (!(CSR_IS_INFRA_AP(pSession->pCurRoamProfile))))
 	    ) {
 		fRet = false;
@@ -6225,7 +6225,7 @@ enum QDF_OPMODE csr_get_session_persona(struct mac_context *pmac,
 	struct csr_roam_session *session = NULL;
 
 	session = CSR_GET_SESSION(pmac, session_id);
-	if (NULL == session || NULL == session->pCurRoamProfile)
+	if (!session || !session->pCurRoamProfile)
 		return QDF_MAX_NO_OF_MODE;
 
 	return session->pCurRoamProfile->csrPersona;
@@ -6261,7 +6261,7 @@ bool csr_is_mcc_channel(struct mac_context *mac_ctx, uint8_t channel)
 	for (session_id = 0; session_id < WLAN_MAX_VDEVS; session_id++) {
 		if (CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
 			session = CSR_GET_SESSION(mac_ctx, session_id);
-			if (NULL == session->pCurRoamProfile)
+			if (!session->pCurRoamProfile)
 				continue;
 			oper_mode = session->pCurRoamProfile->csrPersona;
 			if ((((oper_mode == QDF_STA_MODE) ||

+ 14 - 14
core/sme/src/qos/sme_qos.c

@@ -599,7 +599,7 @@ QDF_STATUS sme_qos_close(struct mac_context *mac)
 	/* shut down all of the sessions */
 	for (sessionId = 0; sessionId < WLAN_MAX_VDEVS; ++sessionId) {
 		pSession = &sme_qos_cb.sessionInfo[sessionId];
-		if (pSession == NULL)
+		if (!pSession)
 			continue;
 
 		sme_qos_init_a_cs(mac, sessionId);
@@ -838,7 +838,7 @@ QDF_STATUS sme_qos_msg_processor(struct mac_context *mac_ctx,
 	case eWNI_SME_ADDTS_RSP:
 		entry = csr_nonscan_active_ll_peek_head(mac_ctx,
 				LL_ACCESS_LOCK);
-		if (NULL == entry)
+		if (!entry)
 			break;
 		command = GET_BASE_ADDR(entry, tSmeCmd, Link);
 		if (eSmeCommandAddTs == command->command) {
@@ -852,7 +852,7 @@ QDF_STATUS sme_qos_msg_processor(struct mac_context *mac_ctx,
 	case eWNI_SME_DELTS_RSP:
 		entry = csr_nonscan_active_ll_peek_head(mac_ctx,
 				LL_ACCESS_LOCK);
-		if (NULL == entry)
+		if (!entry)
 			break;
 		command = GET_BASE_ADDR(entry, tSmeCmd, Link);
 		if (eSmeCommandDelTs == command->command) {
@@ -2923,7 +2923,7 @@ QDF_STATUS sme_qos_ese_process_reassoc_tspec_rsp(struct mac_context *mac,
 	uint32_t tspecIeLen;
 
 	pCsrSession = CSR_GET_SESSION(mac, sessionId);
-	if (NULL == pCsrSession) {
+	if (!pCsrSession) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  FL("session %d not found"), sessionId);
 		return QDF_STATUS_E_FAILURE;
@@ -3132,7 +3132,7 @@ QDF_STATUS sme_qos_create_tspec_ricie(struct mac_context *mac,
 	tDot11fIERICDataDesc ricIE;
 	uint32_t nStatus;
 
-	if (pRICBuffer == NULL || pRICIdentifier == NULL || pRICLength ==
+	if (!pRICBuffer || !pRICIdentifier || pRICLength ==
 								NULL) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			FL("RIC data is NULL, %pK, %pK, %pK"),
@@ -3757,7 +3757,7 @@ QDF_STATUS sme_qos_process_ft_reassoc_rsp_ev(struct mac_context *mac_ctx,
 	uint32_t ric_len;
 #endif
 
-	if (NULL == csr_session) {
+	if (!csr_session) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  FL("The Session pointer is NULL"));
 		return QDF_STATUS_E_FAILURE;
@@ -3903,7 +3903,7 @@ static QDF_STATUS sme_qos_add_ts_req(struct mac_context *mac,
 		pTspec_Info->ts_info.ack_policy;
 	pMsg->req.tspec.type = SME_QOS_TSPEC_IE_TYPE;
 	/*Fill the BSSID pMsg->req.bssId */
-	if (NULL == pSession->assocInfo.pBssDesc) {
+	if (!pSession->assocInfo.pBssDesc) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: %d: BSS descriptor is NULL so we don't send request to PE",
 			  __func__, __LINE__);
@@ -4004,7 +4004,7 @@ static QDF_STATUS sme_qos_del_ts_req(struct mac_context *mac,
 		pTspecInfo->ts_info.ack_policy;
 	pMsg->req.tspec.type = SME_QOS_TSPEC_IE_TYPE;
 	/*Fill the BSSID pMsg->req.bssId */
-	if (NULL == pSession->assocInfo.pBssDesc) {
+	if (!pSession->assocInfo.pBssDesc) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: %d: BSS descriptor is NULL so we don't send request to PE",
 			  __func__, __LINE__);
@@ -4980,7 +4980,7 @@ static QDF_STATUS sme_qos_process_preauth_success_ind(struct mac_context *mac_ct
 	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
 		  FL("invoked on SME session %d"), sessionid);
 
-	if (NULL == sme_session) {
+	if (!sme_session) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  FL("sme_session is NULL"));
 		return QDF_STATUS_E_INVAL;
@@ -5016,7 +5016,7 @@ static QDF_STATUS sme_qos_process_preauth_success_ind(struct mac_context *mac_ct
 		return status;
 
 	/* Data is accessed from saved PreAuth Rsp */
-	if (NULL == sme_session->ftSmeContext.psavedFTPreAuthRsp) {
+	if (!sme_session->ftSmeContext.psavedFTPreAuthRsp) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  FL("psavedFTPreAuthRsp is NULL"));
 		return QDF_STATUS_E_INVAL;
@@ -5485,7 +5485,7 @@ static QDF_STATUS sme_qos_process_add_ts_success_rsp(struct mac_context *mac,
 
 	/* Inform this TSPEC IE change to FW */
 	csr_session = CSR_GET_SESSION(mac, sessionId);
-	if ((csr_session != NULL) && (NULL != csr_session->pCurRoamProfile) &&
+	if ((csr_session) && (csr_session->pCurRoamProfile) &&
 	    (csr_session->pCurRoamProfile->csrPersona == QDF_STA_MODE))
 		csr_roam_offload_scan(mac, sessionId,
 				      ROAM_SCAN_OFFLOAD_UPDATE_CFG,
@@ -5958,7 +5958,7 @@ static bool sme_qos_is_acm(struct mac_context *mac, tSirBssDescription *pSirBssD
 		return false;
 	}
 
-	if (NULL != pIes)
+	if (pIes)
 		/* IEs were provided so use them locally */
 		pIesLocal = pIes;
 	else {
@@ -6004,7 +6004,7 @@ static bool sme_qos_is_acm(struct mac_context *mac, tSirBssDescription *pSirBssD
 	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
 		  "%s: %d: ACM = %d for AC = %d",
 		  __func__, __LINE__, ret_val, ac);
-	if (NULL == pIes)
+	if (!pIes)
 		/* IEs were allocated locally so free them */
 		qdf_mem_free(pIesLocal);
 
@@ -6381,7 +6381,7 @@ static QDF_STATUS sme_qos_save_assoc_info(struct sme_qos_sessioninfo *pSession,
 	tSirBssDescription *pBssDesc = NULL;
 	uint32_t bssLen = 0;
 
-	if (NULL == pAssoc_info) {
+	if (!pAssoc_info) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "%s: %d: pAssoc_info is NULL", __func__, __LINE__);
 		return QDF_STATUS_E_FAILURE;

+ 16 - 16
core/sme/src/rrm/sme_rrm.c

@@ -173,7 +173,7 @@ sme_rrm_send_beacon_report_xmit_ind(struct mac_context *mac_ctx,
 	tpRrmSMEContext rrm_ctx = &mac_ctx->rrm.rrmSmeContext;
 	struct bss_description *tmp_bss_desc[SIR_BCN_REPORT_MAX_BSS_DESC] = {0};
 
-	if (NULL == result_arr && !msrmnt_status) {
+	if (!result_arr && !msrmnt_status) {
 		sme_err("Beacon report xmit Ind to PE Failed");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -198,7 +198,7 @@ sme_rrm_send_beacon_report_xmit_ind(struct mac_context *mac_ctx,
 		i = 0;
 		while (cur_result) {
 			bss_desc = &cur_result->BssDescriptor;
-			if (bss_desc == NULL)
+			if (!bss_desc)
 				break;
 			size =  bss_desc->length + sizeof(bss_desc->length);
 			beacon_rep->pBssDescription[i] = qdf_mem_malloc(size);
@@ -225,7 +225,7 @@ sme_rrm_send_beacon_report_xmit_ind(struct mac_context *mac_ctx,
 		}
 
 		j += i;
-		if (!result_arr || (cur_result == NULL)
+		if (!result_arr || (!cur_result)
 			|| (j >= bss_count)) {
 			cur_result = NULL;
 			sme_debug("Reached to  max/last BSS in cur_result list");
@@ -283,12 +283,12 @@ static QDF_STATUS sme_ese_send_beacon_req_scan_results(
 	uint8_t i = 0, j = 0;
 	tBcnReportFields *bcn_rpt_fields;
 
-	if (NULL == rrm_ctx) {
+	if (!rrm_ctx) {
 		sme_err("rrm_ctx is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (NULL == result_arr && !msrmnt_status) {
+	if (!result_arr && !msrmnt_status) {
 		sme_err("Beacon report xmit Ind to HDD Failed");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -313,7 +313,7 @@ static QDF_STATUS sme_ese_send_beacon_req_scan_results(
 				break;
 			}
 		}
-		if (NULL != cur_meas_req)
+		if (cur_meas_req)
 			bcn_report->measurementToken =
 				cur_meas_req->measurementToken;
 		sme_debug("Channel: %d MeasToken: %d", channel,
@@ -322,7 +322,7 @@ static QDF_STATUS sme_ese_send_beacon_req_scan_results(
 		j = 0;
 		while (cur_result) {
 			bss_desc = &cur_result->BssDescriptor;
-			if (NULL == bss_desc) {
+			if (!bss_desc) {
 				cur_result = NULL;
 				break;
 			}
@@ -332,7 +332,7 @@ static QDF_STATUS sme_ese_send_beacon_req_scan_results(
 			bcn_rpt_fields->ChanNum =
 				bss_desc->channelId;
 			bcn_report->bcnRepBssInfo[j].bcnReportFields.Spare = 0;
-			if (NULL != cur_meas_req)
+			if (cur_meas_req)
 				bcn_rpt_fields->MeasDuration =
 					cur_meas_req->measurementDuration;
 			bcn_rpt_fields->PhyType = bss_desc->nwType;
@@ -482,7 +482,7 @@ static QDF_STATUS sme_rrm_send_scan_result(struct mac_context *mac_ctx,
 		qdf_mem_free(filter.SSIDs.SSIDList);
 
 	sme_debug("RRM Measurement Done %d", measurementdone);
-	if (NULL == result_handle) {
+	if (!result_handle) {
 		/*
 		 * no scan results
 		 * Spec. doesn't say anything about such condition
@@ -510,7 +510,7 @@ static QDF_STATUS sme_rrm_send_scan_result(struct mac_context *mac_ctx,
 		return status;
 	}
 	scan_results = sme_scan_result_get_first(mac_handle, result_handle);
-	if (NULL == scan_results && measurementdone) {
+	if (!scan_results && measurementdone) {
 #ifdef FEATURE_WLAN_ESE
 		if (eRRM_MSG_SOURCE_ESE_UPLOAD == rrm_ctx->msgSource) {
 			status = sme_ese_send_beacon_req_scan_results(mac_ctx,
@@ -550,7 +550,7 @@ static QDF_STATUS sme_rrm_send_scan_result(struct mac_context *mac_ctx,
 	session = CSR_GET_SESSION(mac_ctx, session_id);
 	if ((!session) ||  (!csr_is_conn_state_connected_infra(
 	    mac_ctx, session_id)) ||
-	    (NULL == session->pConnectBssDesc)) {
+	    (!session->pConnectBssDesc)) {
 		sme_err("Invaild session");
 		status = QDF_STATUS_E_FAILURE;
 		goto rrm_send_scan_results_done;
@@ -1144,12 +1144,12 @@ rrm_calculate_neighbor_ap_roam_score(struct mac_context *mac_ctx,
 #ifdef FEATURE_WLAN_ESE
 	uint8_t session_id;
 #endif
-	if (NULL == nbr_report_desc) {
+	if (!nbr_report_desc) {
 		QDF_ASSERT(0);
 		return;
 	}
 
-	if (NULL == nbr_report_desc->pNeighborBssDescription) {
+	if (!nbr_report_desc->pNeighborBssDescription) {
 		QDF_ASSERT(0);
 		return;
 	}
@@ -1226,11 +1226,11 @@ static void rrm_store_neighbor_rpt_by_roam_score(struct mac_context *mac,
 	tListElem *pEntry;
 	tRrmNeighborReportDesc *pTempNeighborReportDesc;
 
-	if (NULL == pNeighborReportDesc) {
+	if (!pNeighborReportDesc) {
 		QDF_ASSERT(0);
 		return;
 	}
-	if (NULL == pNeighborReportDesc->pNeighborBssDescription) {
+	if (!pNeighborReportDesc->pNeighborBssDescription) {
 		QDF_ASSERT(0);
 		return;
 	}
@@ -1251,7 +1251,7 @@ static void rrm_store_neighbor_rpt_by_roam_score(struct mac_context *mac,
 	 */
 	pEntry = csr_ll_peek_head(&pSmeRrmContext->neighborReportCache,
 				LL_ACCESS_LOCK);
-	while (pEntry != NULL) {
+	while (pEntry) {
 		pTempNeighborReportDesc = GET_BASE_ADDR(pEntry,
 					tRrmNeighborReportDesc, List);
 		if (pTempNeighborReportDesc->roamScore <