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
vanhempi 9c49a33a7b
commit eac5aadbc9
2 muutettua tiedostoa jossa 7 lisäystä ja 10 poistoa

Näytä tiedosto

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

Näytä tiedosto

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