diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index e91bfb163cb9..773d5dda2c88 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -139,7 +139,7 @@ static QDF_STATUS sap_hdd_signal_event_handler(void *ctx) struct sap_context *sap_ctx = ctx; QDF_STATUS status; - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("sap context is not valid")); return QDF_STATUS_E_FAILURE; @@ -268,7 +268,7 @@ QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(mac_handle_t mac_handle, sap_ctx->sap_status = eSAP_STATUS_SUCCESS; close_session: #ifdef SOFTAP_CHANNEL_RANGE - if (sap_ctx->channelList != NULL) { + if (sap_ctx->channelList) { /* * Always free up the memory for * channel selection whatever @@ -536,7 +536,7 @@ wlansap_roam_process_dfs_chansw_update(mac_handle_t mac_handle, struct sap_context *sap_context; if (!((QDF_SAP_MODE == mac_ctx->sap.sapCtxList[intf].sapPersona) - && (mac_ctx->sap.sapCtxList[intf].sap_context != NULL))) + && (mac_ctx->sap.sapCtxList[intf].sap_context))) continue; sap_context = mac_ctx->sap.sapCtxList[intf].sap_context; QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED, diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 38f5bd554b2e..e9f7aa75a794 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -491,8 +491,8 @@ uint8_t sap_channel_in_acs_channel_list(uint8_t channel_num, { uint8_t i = 0; - if ((NULL == sap_ctx->acs_cfg->ch_list) || - (NULL == spect_info_params)) + if ((!sap_ctx->acs_cfg->ch_list) || + (!spect_info_params)) return channel_num; if (channel_num > 0 && channel_num <= 252) { @@ -526,7 +526,7 @@ uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl, uint8_t i = 0; struct mac_context *mac_ctx = sme_get_mac_context(); - if (NULL == mac_ctx) { + if (!mac_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "pmac Global Context is NULL"); return SAP_CHANNEL_NOT_SELECTED; @@ -536,8 +536,8 @@ uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl, * If Channel List is not Configured don't do anything * Else return the Best Channel from the Channel List */ - if ((NULL == sap_ctx->acs_cfg->ch_list) || - (NULL == spectinfo_param) || + if ((!sap_ctx->acs_cfg->ch_list) || + (!spectinfo_param) || (0 == sap_ctx->acs_cfg->ch_list_count)) return best_chnl; @@ -808,7 +808,7 @@ static uint32_t sap_weight_channel_noise_floor(struct sap_context *sap_ctx, ACS_WEIGHT_CFG_TO_LOCAL(sap_ctx->auto_channel_select_weight, softap_nf_weight_cfg); - if (channel_stat == NULL || channel_stat->channelfreq == 0) { + if (!channel_stat || channel_stat->channelfreq == 0) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, "In %s, sanity check failed return max weight", __func__); @@ -860,7 +860,7 @@ static uint32_t sap_weight_channel_free(struct sap_context *sap_ctx, ACS_WEIGHT_CFG_TO_LOCAL(sap_ctx->auto_channel_select_weight, softap_channel_free_weight_cfg); - if (channel_stat == NULL || channel_stat->channelfreq == 0) { + if (!channel_stat || channel_stat->channelfreq == 0) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, "In %s, sanity check failed return max weight", __func__); @@ -921,7 +921,7 @@ static uint32_t sap_weight_channel_txpwr_range(struct sap_context *sap_ctx, ACS_WEIGHT_CFG_TO_LOCAL(sap_ctx->auto_channel_select_weight, softap_txpwr_range_weight_cfg); - if (channel_stat == NULL || channel_stat->channelfreq == 0) { + if (!channel_stat || channel_stat->channelfreq == 0) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, "In %s, sanity check failed return max weight", __func__); @@ -973,7 +973,7 @@ static uint32_t sap_weight_channel_txpwr_tput(struct sap_context *sap_ctx, ACS_WEIGHT_CFG_TO_LOCAL(sap_ctx->auto_channel_select_weight, softap_txpwr_tput_weight_cfg); - if (channel_stat == NULL || channel_stat->channelfreq == 0) { + if (!channel_stat || channel_stat->channelfreq == 0) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, "In %s, sanity check failed return max weight", __func__); @@ -1059,7 +1059,7 @@ static void sap_update_rssi_bsscount(tSapSpectChInfo *pSpectCh, int32_t offset, int32_t rssi, rsssi_effect; pExtSpectCh = (pSpectCh + offset); - if (pExtSpectCh != NULL && + if (pExtSpectCh && pExtSpectCh >= spectch_start && pExtSpectCh < spectch_end) { if (!sap_check_channels_same_band(pSpectCh->chNum, @@ -1138,7 +1138,7 @@ static void sap_upd_chan_spec_params(tSirProbeRespBeacon *pBeaconStruct, uint16_t *centerFreq, uint16_t *centerFreq_2) { - if (NULL == pBeaconStruct) { + if (!pBeaconStruct) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("pBeaconStruct is NULL")); return; @@ -1236,7 +1236,7 @@ static void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, uint16_t num_ch; int32_t offset = 0; - if (NULL == spect_ch) { + if (!spect_ch) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("spect_ch is NULL")); return; @@ -1325,7 +1325,7 @@ static void sap_interference_rssi_count(tSapSpectChInfo *spect_ch, tSapSpectChInfo *spectch_start, tSapSpectChInfo *spectch_end) { - if (NULL == spect_ch) { + if (!spect_ch) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: spect_ch is NULL", __func__); return; @@ -2659,7 +2659,7 @@ uint8_t sap_select_channel(mac_handle_t mac_handle, * If ACS weight is not enabled on noise_floor/channel_free/tx_power, * then skip acs process if no bss found. */ - if (NULL == scan_result && + if (!scan_result && !(sap_ctx->auto_channel_select_weight & 0xffff00)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("No external AP present")); diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 4f2a066df60b..3c0c01b24d2d 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -290,7 +290,7 @@ static uint8_t sap_get_bonding_channels(struct sap_context *sapContext, { uint8_t numChannel; - if (channels == NULL) + if (!channels) return 0; if (size < MAX_BONDED_CHANNELS) @@ -696,7 +696,7 @@ uint8_t sap_select_default_oper_chan(struct sap_acs_cfg *acs_cfg) { uint8_t channel; - if (NULL == acs_cfg) { + if (!acs_cfg) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "ACS config invalid!"); QDF_BUG(0); @@ -1050,7 +1050,7 @@ QDF_STATUS sap_channel_sel(struct sap_context *sap_context) sap_context->acs_cfg); #ifdef SOFTAP_CHANNEL_RANGE - if (sap_context->channelList != NULL) { + if (sap_context->channelList) { sap_context->channel = sap_context->channelList[0]; qdf_mem_free(sap_context-> @@ -1121,7 +1121,7 @@ sap_find_valid_concurrent_session(mac_handle_t mac_handle) mac_ctx->sap.sapCtxList[intf].sapPersona) || (QDF_P2P_GO_MODE == mac_ctx->sap.sapCtxList[intf].sapPersona)) && - mac_ctx->sap.sapCtxList[intf].sap_context != NULL) { + mac_ctx->sap.sapCtxList[intf].sap_context) { sap_ctx = mac_ctx->sap.sapCtxList[intf].sap_context; if (sap_ctx->fsm_state != SAP_INIT) return sap_ctx; @@ -1135,7 +1135,7 @@ static QDF_STATUS sap_clear_global_dfs_param(mac_handle_t mac_handle) { struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle); - if (NULL != sap_find_valid_concurrent_session(mac_handle)) { + if (sap_find_valid_concurrent_session(mac_handle)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, "conc session exists, no need to clear dfs struct"); return QDF_STATUS_SUCCESS; @@ -1465,7 +1465,7 @@ QDF_STATUS sap_signal_hdd_event(struct sap_context *sap_ctx, tSap_StationMICFailureEvent *mic_failure; /* Format the Start BSS Complete event to return... */ - if (NULL == sap_ctx->pfnSapEventCallback) { + if (!sap_ctx->pfnSapEventCallback) { return QDF_STATUS_E_FAILURE; } @@ -1500,7 +1500,7 @@ QDF_STATUS sap_signal_hdd_event(struct sap_context *sap_ctx, assoc_ind->assocReqPtr = csr_roaminfo->assocReqPtr; assoc_ind->fWmmEnabled = csr_roaminfo->wmmEnabledSta; assoc_ind->ecsa_capable = csr_roaminfo->ecsa_capable; - if (csr_roaminfo->u.pConnectedProfile != NULL) { + if (csr_roaminfo->u.pConnectedProfile) { assoc_ind->negotiatedAuthType = csr_roaminfo->u.pConnectedProfile->AuthType; assoc_ind->negotiatedUCEncryptionType = @@ -1917,7 +1917,7 @@ void sap_cac_reset_notify(mac_handle_t mac_handle) if (((QDF_SAP_MODE == mac->sap.sapCtxList[intf].sapPersona) || (QDF_P2P_GO_MODE == mac->sap.sapCtxList[intf].sapPersona)) - && mac->sap.sapCtxList[intf].sap_context != NULL) { + && mac->sap.sapCtxList[intf].sap_context) { sap_context->isCacStartNotified = false; sap_context->isCacEndNotified = false; } @@ -1947,7 +1947,7 @@ static QDF_STATUS sap_cac_start_notify(mac_handle_t mac_handle) if (((QDF_SAP_MODE == mac->sap.sapCtxList[intf].sapPersona) || (QDF_P2P_GO_MODE == mac->sap.sapCtxList[intf].sapPersona)) - && mac->sap.sapCtxList[intf].sap_context != NULL && + && mac->sap.sapCtxList[intf].sap_context && (false == sap_context->isCacStartNotified)) { /* Don't start CAC for non-dfs channel, its violation */ profile = &sap_context->csr_roamProfile; @@ -2041,7 +2041,7 @@ static QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle, if (((QDF_SAP_MODE == mac->sap.sapCtxList[intf].sapPersona) || (QDF_P2P_GO_MODE == mac->sap.sapCtxList[intf].sapPersona)) - && mac->sap.sapCtxList[intf].sap_context != NULL && + && mac->sap.sapCtxList[intf].sap_context && (false == sap_context->isCacEndNotified) && sap_is_dfs_cac_wait_state(sap_context)) { sap_context = mac->sap.sapCtxList[intf].sap_context; @@ -2536,7 +2536,7 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(struct sap_context *sap_ctx, * mulitple APs: incase of multiple APs, make sure that * all APs are down. */ - if (NULL == sap_find_valid_concurrent_session(mac_handle)) { + if (!sap_find_valid_concurrent_session(mac_handle)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED, FL("sapdfs: no sessions are valid, stopping timer")); @@ -2799,7 +2799,7 @@ static QDF_STATUS sap_fsm_state_started(struct sap_context *sap_ctx, mac_ctx->sap.sapCtxList[intf].sapPersona) || (QDF_P2P_GO_MODE == mac_ctx->sap.sapCtxList[intf].sapPersona)) && - mac_ctx->sap.sapCtxList[intf].sap_context != NULL) { + mac_ctx->sap.sapCtxList[intf].sap_context) { temp_sap_ctx = mac_ctx->sap.sapCtxList[intf].sap_context; /* @@ -3053,7 +3053,7 @@ sapconvert_to_csr_profile(tsap_config_t *pconfig_params, eCsrRoamBssType bssType #endif if (pconfig_params->probeRespIEsBufferLen > 0 && - pconfig_params->pProbeRespIEsBuffer != NULL) { + pconfig_params->pProbeRespIEsBuffer) { profile->add_ie_params.probeRespDataLen = pconfig_params->probeRespIEsBufferLen; profile->add_ie_params.probeRespData_buff = @@ -3064,7 +3064,7 @@ sapconvert_to_csr_profile(tsap_config_t *pconfig_params, eCsrRoamBssType bssType } /*assoc resp IE */ if (pconfig_params->assocRespIEsLen > 0 && - pconfig_params->pAssocRespIEsBuffer != NULL) { + pconfig_params->pAssocRespIEsBuffer) { profile->add_ie_params.assocRespDataLen = pconfig_params->assocRespIEsLen; profile->add_ie_params.assocRespData_buff = @@ -3075,7 +3075,7 @@ sapconvert_to_csr_profile(tsap_config_t *pconfig_params, eCsrRoamBssType bssType } if (pconfig_params->probeRespBcnIEsLen > 0 && - pconfig_params->pProbeRespBcnIEsBuffer != NULL) { + pconfig_params->pProbeRespBcnIEsBuffer) { profile->add_ie_params.probeRespBCNDataLen = pconfig_params->probeRespBcnIEsLen; profile->add_ie_params.probeRespBCNData_buff = @@ -3121,7 +3121,7 @@ void sap_sort_mac_list(struct qdf_mac_addr *macList, uint8_t size) struct qdf_mac_addr temp; int32_t nRes = -1; - if ((NULL == macList) || (size > MAX_ACL_MAC_ADDRESS)) { + if ((!macList) || (size > MAX_ACL_MAC_ADDRESS)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("either buffer is NULL or size = %d is more"), size); return; @@ -3157,7 +3157,7 @@ sap_search_mac_list(struct qdf_mac_addr *macList, nEnd = num_mac - 1; - if ((NULL == macList) || (num_mac > MAX_ACL_MAC_ADDRESS)) { + if ((!macList) || (num_mac > MAX_ACL_MAC_ADDRESS)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("either buffer is NULL or size = %d is more."), num_mac); return false; @@ -3174,7 +3174,7 @@ sap_search_mac_list(struct qdf_mac_addr *macList, "search SUCC"); /* "index equals NULL" means the caller does not need the */ /* index value of the peerMac being searched */ - if (index != NULL) { + if (index) { *index = (uint8_t) nMiddle; QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "index %d", @@ -3202,7 +3202,7 @@ void sap_add_mac_to_acl(struct qdf_mac_addr *macList, QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "add acl entered"); - if (NULL == macList || *size > MAX_ACL_MAC_ADDRESS) { + if (!macList || *size > MAX_ACL_MAC_ADDRESS) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("either buffer is NULL or size = %d is incorrect."), *size); @@ -3240,7 +3240,7 @@ void sap_remove_mac_from_acl(struct qdf_mac_addr *macList, * the index of the mac addr to be removed and this will only get * called if the search is successful. Still no harm in having the check */ - if ((macList == NULL) || (*size == 0) || + if ((!macList) || (*size == 0) || (*size > MAX_ACL_MAC_ADDRESS)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("either buffer is NULL or size %d is incorrect."), @@ -3267,7 +3267,7 @@ void sap_print_acl(struct qdf_mac_addr *macList, uint8_t size) QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "print acl entered"); - if ((NULL == macList) || (size == 0) || (size >= MAX_ACL_MAC_ADDRESS)) { + if ((!macList) || (size == 0) || (size >= MAX_ACL_MAC_ADDRESS)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "In %s, either buffer is NULL or size %d is incorrect.", __func__, size); @@ -3621,14 +3621,14 @@ void sap_dfs_cac_timer_callback(void *data) mac_handle_t mac_handle = data; struct mac_context *mac; - if (NULL == mac_handle) { + if (!mac_handle) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "In %s invalid mac_handle", __func__); return; } mac = MAC_CONTEXT(mac_handle); sapContext = sap_find_cac_wait_session(mac_handle); - if (NULL == sapContext) { + if (!sapContext) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: no SAP contexts in wait state", __func__); return; @@ -3829,7 +3829,7 @@ uint8_t sap_get_total_number_sap_intf(mac_handle_t mac_handle) if (((QDF_SAP_MODE == mac->sap.sapCtxList[intf].sapPersona) || (QDF_P2P_GO_MODE == mac->sap.sapCtxList[intf].sapPersona)) - && mac->sap.sapCtxList[intf].sap_context != NULL) { + && mac->sap.sapCtxList[intf].sap_context) { intf_count++; } } @@ -3859,7 +3859,7 @@ bool is_concurrent_sap_ready_for_channel_change(mac_handle_t mac_handle, if (((QDF_SAP_MODE == mac->sap.sapCtxList[intf].sapPersona) || (QDF_P2P_GO_MODE == mac->sap.sapCtxList[intf].sapPersona)) - && mac->sap.sapCtxList[intf].sap_context != NULL) { + && mac->sap.sapCtxList[intf].sap_context) { sap_context = mac->sap.sapCtxList[intf].sap_context; if (sap_context == sapContext) { diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 57ece8dfcbd0..c3e8cd53d208 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -132,7 +132,7 @@ static QDF_STATUS wlansap_save_context(struct sap_context *ctx) qdf_mutex_acquire(&sap_context_lock); for (i = 0; i < SAP_MAX_NUM_SESSION; i++) { - if (gp_sap_ctx[i] == NULL) { + if (!gp_sap_ctx[i]) { gp_sap_ctx[i] = ctx; qdf_atomic_inc(&sap_ctx_ref_count[i]); qdf_mutex_release(&sap_context_lock); @@ -316,7 +316,7 @@ QDF_STATUS sap_init_ctx(struct sap_context *sap_ctx, QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "wlansap_start invoked successfully"); - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -378,7 +378,7 @@ QDF_STATUS sap_deinit_ctx(struct sap_context *sap_ctx) QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, "wlansap_stop invoked successfully "); - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -414,7 +414,7 @@ QDF_STATUS sap_destroy_ctx(struct sap_context *sap_ctx) QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("Enter")); - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -519,13 +519,13 @@ wlansap_set_scan_acs_channel_params(tsap_config_t *pconfig, struct mac_context *mac; QDF_STATUS status = QDF_STATUS_SUCCESS; - if (NULL == pconfig) { + if (!pconfig) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid pconfig passed ", __func__); return QDF_STATUS_E_FAULT; } - if (NULL == psap_ctx) { + if (!psap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid pconfig passed ", __func__); return QDF_STATUS_E_FAULT; @@ -672,7 +672,7 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx, QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("sapContext=%pK"), sap_ctx); - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "%s: Invalid SAP pointer", __func__); @@ -777,7 +777,7 @@ QDF_STATUS wlansap_set_mac_acl(struct sap_context *sap_ctx, QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "wlansap_set_mac_acl"); - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -807,7 +807,7 @@ QDF_STATUS wlansap_stop_bss(struct sap_context *sap_ctx) tWLAN_SAPEvent sapEvent; /* State machine event */ QDF_STATUS qdf_status; - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -827,7 +827,7 @@ QDF_STATUS wlansap_stop_bss(struct sap_context *sap_ctx) QDF_STATUS wlansap_set_acl_mode(struct sap_context *sap_ctx, eSapMacAddrACL mode) { - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -840,7 +840,7 @@ QDF_STATUS wlansap_set_acl_mode(struct sap_context *sap_ctx, QDF_STATUS wlansap_get_acl_mode(struct sap_context *sap_ctx, eSapMacAddrACL *mode) { - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -854,7 +854,7 @@ QDF_STATUS wlansap_get_acl_accept_list(struct sap_context *sap_ctx, struct qdf_mac_addr *pAcceptList, uint8_t *nAcceptList) { - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -870,7 +870,7 @@ QDF_STATUS wlansap_get_acl_deny_list(struct sap_context *sap_ctx, struct qdf_mac_addr *pDenyList, uint8_t *nDenyList) { - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer from p_cds_gctx", __func__); return QDF_STATUS_E_FAULT; @@ -886,7 +886,7 @@ QDF_STATUS wlansap_clear_acl(struct sap_context *sap_ctx) { uint8_t i; - if (NULL == sap_ctx) { + if (!sap_ctx) { return QDF_STATUS_E_RESOURCES; } @@ -916,7 +916,7 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx, bool sta_white_list = false, sta_black_list = false; uint8_t staWLIndex, staBLIndex; - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP Context", __func__); return QDF_STATUS_E_FAULT; @@ -1308,7 +1308,7 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sapContext, QDF_STATUS status; bool sta_sap_scc_on_dfs_chan; - if (NULL == sapContext) { + if (!sapContext) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); @@ -1516,7 +1516,7 @@ QDF_STATUS wlan_sap_getstation_ie_information(struct sap_context *sap_ctx, QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; uint32_t ie_len = 0; - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("Invalid SAP pointer")); return QDF_STATUS_E_FAULT; @@ -1706,7 +1706,7 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext, return QDF_STATUS_E_FAULT; } - if (NULL == sapContext) { + if (!sapContext) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -1736,7 +1736,7 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext, sapContext->csr_roamProfile.phyMode = phy_mode; if (sapContext->csr_roamProfile.ChannelInfo.numOfChannels == 0 || - sapContext->csr_roamProfile.ChannelInfo.ChannelList == NULL) { + !sapContext->csr_roamProfile.ChannelInfo.ChannelList) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("Invalid channel list")); return QDF_STATUS_E_FAULT; @@ -1791,7 +1791,7 @@ QDF_STATUS wlansap_start_beacon_req(struct sap_context *sap_ctx) uint8_t dfs_cac_wait_status; struct mac_context *mac; - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -1820,7 +1820,7 @@ QDF_STATUS wlansap_dfs_send_csa_ie_request(struct sap_context *sap_ctx) { struct mac_context *mac; - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; @@ -1857,7 +1857,7 @@ QDF_STATUS wlansap_get_dfs_ignore_cac(mac_handle_t mac_handle, { struct mac_context *mac = NULL; - if (NULL != mac_handle) { + if (mac_handle) { mac = MAC_CONTEXT(mac_handle); } else { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, @@ -1874,7 +1874,7 @@ QDF_STATUS wlansap_set_dfs_ignore_cac(mac_handle_t mac_handle, { struct mac_context *mac = NULL; - if (NULL != mac_handle) { + if (mac_handle) { mac = MAC_CONTEXT(mac_handle); } else { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, @@ -1889,7 +1889,7 @@ QDF_STATUS wlansap_set_dfs_ignore_cac(mac_handle_t mac_handle, bool sap_is_auto_channel_select(struct sap_context *sapcontext) { - if (NULL == sapcontext) { + if (!sapcontext) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); return false; @@ -1913,7 +1913,7 @@ wlan_sap_set_channel_avoidance(mac_handle_t mac_handle, { struct mac_context *mac_ctx = NULL; - if (NULL != mac_handle) { + if (mac_handle) { mac_ctx = MAC_CONTEXT(mac_handle); } else { QDF_TRACE(QDF_MODULE_ID_SAP, @@ -1950,7 +1950,7 @@ wlansap_set_dfs_preferred_channel_location(mac_handle_t mac_handle, QDF_STATUS status; enum dfs_reg dfs_region; - if (NULL != mac_handle) { + if (mac_handle) { mac = MAC_CONTEXT(mac_handle); } else { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, @@ -1992,7 +1992,7 @@ QDF_STATUS wlansap_set_dfs_target_chnl(mac_handle_t mac_handle, { struct mac_context *mac = NULL; - if (NULL != mac_handle) { + if (mac_handle) { mac = MAC_CONTEXT(mac_handle); } else { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, @@ -2020,11 +2020,11 @@ wlansap_update_sap_config_add_ie(tsap_config_t *pConfig, uint16_t bufferLength = 0; uint8_t *pBuffer = NULL; - if (NULL == pConfig) { + if (!pConfig) { return QDF_STATUS_E_FAULT; } - if ((pAdditionIEBuffer != NULL) && (additionIELength != 0)) { + if ((pAdditionIEBuffer) && (additionIELength != 0)) { /* initialize the buffer pointer so that pe can copy */ if (additionIELength > 0) { bufferLength = additionIELength; @@ -2084,7 +2084,7 @@ wlansap_update_sap_config_add_ie(tsap_config_t *pConfig, default: QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO, FL("No matching buffer type %d"), updateType); - if (pBuffer != NULL) + if (pBuffer) qdf_mem_free(pBuffer); break; } @@ -2095,7 +2095,7 @@ wlansap_update_sap_config_add_ie(tsap_config_t *pConfig, QDF_STATUS wlansap_reset_sap_config_add_ie(tsap_config_t *pConfig, eUpdateIEsType updateType) { - if (NULL == pConfig) { + if (!pConfig) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid Config pointer", __func__); return QDF_STATUS_E_FAULT; @@ -2299,7 +2299,7 @@ void wlansap_populate_del_sta_params(const uint8_t *mac, uint8_t subtype, struct csr_del_sta_params *pDelStaParams) { - if (NULL == mac) + if (!mac) qdf_set_macaddr_broadcast(&pDelStaParams->peerMacAddr); else qdf_mem_copy(pDelStaParams->peerMacAddr.bytes, mac, @@ -2332,7 +2332,7 @@ QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context, QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; struct mac_context *mac; - if (NULL == sap_context) { + if (!sap_context) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Invalid SAP pointer", __func__); @@ -2439,7 +2439,7 @@ uint32_t wlansap_get_chan_width(struct sap_context *sap_ctx) QDF_STATUS wlansap_set_invalid_session(struct sap_context *sap_ctx) { - if (NULL == sap_ctx) { + if (!sap_ctx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, FL("Invalid SAP pointer")); return QDF_STATUS_E_FAILURE;