diff --git a/lib/src/phy/phch/pdsch.c b/lib/src/phy/phch/pdsch.c index 008704b23..225bd2213 100644 --- a/lib/src/phy/phch/pdsch.c +++ b/lib/src/phy/phch/pdsch.c @@ -914,7 +914,7 @@ int srslte_pdsch_decode(srslte_pdsch_t* q, /* Set pointers for layermapping & precoding */ uint32_t i; - cf_t* x[SRSLTE_MAX_LAYERS]; + cf_t** x; if (q != NULL && sf_symbols != NULL && data != NULL && cfg != NULL) { @@ -978,15 +978,10 @@ int srslte_pdsch_decode(srslte_pdsch_t* q, if (cfg->grant.nof_layers == nof_tb) { /* Skip layer demap */ - for (i = 0; i < cfg->grant.nof_layers; i++) { - x[i] = q->d[i]; - } + x = q->d; } else { /* number of layers equals number of ports */ - for (i = 0; i < cfg->grant.nof_layers; i++) { - x[i] = q->x[i]; - } - memset(&x[cfg->grant.nof_layers], 0, sizeof(cf_t*) * (SRSLTE_MAX_LAYERS - cfg->grant.nof_layers)); + x = q->x; } // Pre-decoder diff --git a/lib/src/phy/ue/ue_dl.c b/lib/src/phy/ue/ue_dl.c index 5cdde0862..6b0434ce9 100644 --- a/lib/src/phy/ue/ue_dl.c +++ b/lib/src/phy/ue/ue_dl.c @@ -531,7 +531,7 @@ static int dci_blind_search(srslte_ue_dl_t* q, } else if (!find_dci(dci_msg, (uint32_t)nof_dci, &dci_msg[nof_dci]) && !find_dci(q->pending_ul_dci_msg, q->pending_ul_dci_count, &dci_msg[nof_dci])) { // Save message and continue with next location - if (q->nof_allocated_locations <= SRSLTE_MAX_DCI_MSG) { + if (q->nof_allocated_locations < SRSLTE_MAX_DCI_MSG) { q->allocated_locations[q->nof_allocated_locations] = dci_msg[nof_dci].location; q->nof_allocated_locations++; }