qcacld-3.0: Avoid NULL checking result of & operation

In LIM there are two separate places where the code iterates over the
gpSession[] array and tests each &mac_ctx->lim.gpSession[i] for NULL.
These NULL checks are unnecessary, so remove them.

Change-Id: Ice7435b19cc9fc61ebe11537e0aa6acd1b61984d
CRs-Fixed: 2419289
This commit is contained in:
Jeff Johnson
2019-03-19 12:57:04 -07:00
committed by nshrivas
parent 9c49a33a7b
commit eac5aadbc9
2 changed files with 7 additions and 10 deletions

View File

@@ -144,14 +144,13 @@ static QDF_STATUS lim_check_sta_in_pe_entries(struct mac_context *mac_ctx,
uint8_t i; uint8_t i;
uint16_t assoc_id = 0; uint16_t assoc_id = 0;
tpDphHashNode sta_ds = NULL; tpDphHashNode sta_ds = NULL;
struct pe_session *session = NULL; struct pe_session *session;
*dup_entry = false; *dup_entry = false;
for (i = 0; i < mac_ctx->lim.maxBssId; i++) { for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
if ((&mac_ctx->lim.gpSession[i] != NULL) && session = &mac_ctx->lim.gpSession[i];
(mac_ctx->lim.gpSession[i].valid) && if (session->valid &&
(mac_ctx->lim.gpSession[i].pePersona == QDF_SAP_MODE)) { (session->pePersona == QDF_SAP_MODE)) {
session = &mac_ctx->lim.gpSession[i];
sta_ds = dph_lookup_hash_entry(mac_ctx, hdr->sa, sta_ds = dph_lookup_hash_entry(mac_ctx, hdr->sa,
&assoc_id, &session->dph.dphHashTable); &assoc_id, &session->dph.dphHashTable);
if (sta_ds if (sta_ds

View File

@@ -662,12 +662,10 @@ void lim_send_sme_disassoc_ntf(struct mac_context *mac,
MAC_ADDR_ARRAY(peerMacAddr)); MAC_ADDR_ARRAY(peerMacAddr));
for (i = 0; i < mac->lim.maxBssId; i++) { for (i = 0; i < mac->lim.maxBssId; i++) {
if ((&mac->lim.gpSession[i] != NULL) && session = &mac->lim.gpSession[i];
(mac->lim.gpSession[i].valid) && if (session->valid &&
(mac->lim.gpSession[i].pePersona == (session->pePersona == QDF_SAP_MODE)) {
QDF_SAP_MODE)) {
/* Find the sta ds entry in another session */ /* Find the sta ds entry in another session */
session = &mac->lim.gpSession[i];
sta_ds = dph_lookup_hash_entry(mac, sta_ds = dph_lookup_hash_entry(mac,
peerMacAddr, &assoc_id, peerMacAddr, &assoc_id,
&session->dph.dphHashTable); &session->dph.dphHashTable);