summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDundi Raviteja <dundi@codeaurora.org>2018-06-12 16:10:42 +0530
committernshrivas <nshrivas@codeaurora.org>2018-06-18 03:01:43 -0700
commitced382b1ffba0a9f257cef5dba286cb35c666c1c (patch)
treef4aaddc563c0663bf7c0c4f9323b64f1c252d2a2
parentd73322cae98c9e47700ede291bdf1f28d099c329 (diff)
qcacld-3.0: Incorrect usage of QDF_ARRAY_SIZE macro
In some use cases of QDF_ARRAY_SIZE macro, the argument passing to it is a pointer instead of array which leads to getting incorrect array size. Current implementation of updating main arrays pcl_list_org and weight_list_org is inefficient. So, update the main arrays directly, instead of copying the data to local arrays and again updating the main arrays. Change-Id: I9a4a7fa813412fd000ce55d2a958e49ab1b02ed5 CRs-Fixed: 2258891
-rw-r--r--core/cds/src/cds_concurrency.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index f2c4b6a1fb63..c4ce2e6fcc19 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -5540,8 +5540,6 @@ static QDF_STATUS cds_modify_pcl_based_on_enabled_channels(
{
cds_context_type *cds_ctx;
uint32_t i, pcl_len = 0;
- uint8_t pcl_list[QDF_MAX_NUM_CHAN];
- uint8_t weight_list[QDF_MAX_NUM_CHAN];
cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
if (!cds_ctx) {
@@ -5551,15 +5549,10 @@ static QDF_STATUS cds_modify_pcl_based_on_enabled_channels(
for (i = 0; i < *pcl_len_org; i++) {
if (!CDS_IS_PASSIVE_OR_DISABLE_CH(pcl_list_org[i])) {
- pcl_list[pcl_len] = pcl_list_org[i];
- weight_list[pcl_len++] = weight_list_org[i];
+ pcl_list_org[pcl_len] = pcl_list_org[i];
+ weight_list_org[pcl_len++] = weight_list_org[i];
}
}
-
- qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org));
- qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org));
- qdf_mem_copy(pcl_list_org, pcl_list, pcl_len);
- qdf_mem_copy(weight_list_org, weight_list, pcl_len);
*pcl_len_org = pcl_len;
return QDF_STATUS_SUCCESS;
@@ -10035,8 +10028,6 @@ QDF_STATUS cds_modify_sap_pcl_based_on_mandatory_channel(uint8_t *pcl_list_org,
{
cds_context_type *cds_ctx;
uint32_t i, j, pcl_len = 0;
- uint8_t pcl_list[QDF_MAX_NUM_CHAN];
- uint8_t weight_list[QDF_MAX_NUM_CHAN];
bool found;
cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
@@ -10067,15 +10058,10 @@ QDF_STATUS cds_modify_sap_pcl_based_on_mandatory_channel(uint8_t *pcl_list_org,
}
}
if (found) {
- pcl_list[pcl_len] = pcl_list_org[i];
- weight_list[pcl_len++] = weight_list_org[i];
+ pcl_list_org[pcl_len] = pcl_list_org[i];
+ weight_list_org[pcl_len++] = weight_list_org[i];
}
}
-
- qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org));
- qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org));
- qdf_mem_copy(pcl_list_org, pcl_list, pcl_len);
- qdf_mem_copy(weight_list_org, weight_list, pcl_len);
*pcl_len_org = pcl_len;
return QDF_STATUS_SUCCESS;