From 2ab6b88d64ca2e4c14d40093be993b0cf10db791 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 23 Jan 2026 17:03:08 +0100 Subject: [PATCH] Remove write-only or unused variables --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 7 +++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 +---- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 5 ----- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index dbf285e931..2ee068121b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -326,7 +326,7 @@ static uint32_t update_dlsch_buffer(frame_t frame, slot_t slot, NR_UE_info_t *UE { NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; sched_ctrl->num_total_bytes = 0; - sched_ctrl->dl_pdus_total = 0; + int dl_pdus_total = 0; logical_chan_id_t ch[NR_MAX_NUM_LCID] = {0}; int n = 0; @@ -350,7 +350,7 @@ static uint32_t update_dlsch_buffer(frame_t frame, slot_t slot, NR_UE_info_t *UE continue; sched_ctrl->rlc_status[lcid] = ret[i]; - sched_ctrl->dl_pdus_total += sched_ctrl->rlc_status[lcid].pdus_in_buffer; + dl_pdus_total += sched_ctrl->rlc_status[lcid].pdus_in_buffer; sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; LOG_D(MAC, "%4d.%2d UE %04x LCID %d status: %d bytes, %d PDUs, total buffer %d bytes %d PDUs\n", @@ -361,7 +361,7 @@ static uint32_t update_dlsch_buffer(frame_t frame, slot_t slot, NR_UE_info_t *UE ret[i].bytes_in_buffer, ret[i].pdus_in_buffer, sched_ctrl->num_total_bytes, - sched_ctrl->dl_pdus_total); + dl_pdus_total); } return sched_ctrl->num_total_bytes; } @@ -914,7 +914,6 @@ static void pf_dl(gNB_MAC_INST *mac, // (for 4 PDUs) and optionally + 2 for TA. Once RLC gives the number of // PDUs, we replace with 3 * numPDUs const int oh = 3 * 4 + (sched_ctrl->ta_apply ? 2 : 0); - //const int oh = 3 * sched_ctrl->dl_pdus_total + (sched_ctrl->ta_apply ? 2 : 0); nr_find_nb_rb(sched_pdsch.Qm, sched_pdsch.R, 1, // no transform precoding for DL diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 0998eb463b..e67e99d96a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -568,7 +568,6 @@ static int nr_process_mac_pdu(instance_t module_idP, sched_pusch->dmrs_info.num_dmrs_symb * sched_pusch->dmrs_info.N_PRB_DMRS, // n_dmrs deltaMCS, true); - sched_ctrl->ph0 = PH; /* 38.133 Table10.1.18.1-1 */ sched_ctrl->pcmax = PCMAX - 29; LOG_D(NR_MAC, @@ -856,7 +855,6 @@ static void nr_rx_ra_sdu(const module_id_t mod_id, } if (timing_advance != 0xffff) UE_scheduling_control->ta_update = timing_advance; - UE_scheduling_control->raw_rssi = rssi; LOG_D(NR_MAC, "[UE %04x] PUSCH TPC %d and TA %d\n", UE->rnti, UE_scheduling_control->tpc0, UE_scheduling_control->ta_update); LOG_D(NR_MAC, "[RAPROC] Received %s:\n", ra->ra_type == RA_2_STEP ? "MsgA-PUSCH" : "Msg3"); @@ -987,7 +985,6 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, if (timing_advance != 0xffff) UE_scheduling_control->ta_update = timing_advance; - UE_scheduling_control->raw_rssi = rssi; UE_scheduling_control->pusch_snrx10 = ul_cqi * 5 - 640 - (txpower_calc * 10); if (UE_scheduling_control->tpc0 > 1) LOG_D(NR_MAC, @@ -998,7 +995,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, UE_scheduling_control->tpc0, UE_scheduling_control->ta_update, UE_scheduling_control->pusch_snrx10, - UE_scheduling_control->raw_rssi, + rssi, txpower_calc, UE_scheduling_control->ph, UE_scheduling_control->ul_harq_processes[harq_pid].sched_pusch.mcs, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index adbba9c772..4de07ad299 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -628,8 +628,6 @@ typedef struct { /// PHR info: power headroom level (dB) int ph; - /// PHR info: power headroom level (dB) for 1 PRB - int ph0; /// PHR info: nominal UE transmit power levels (dBm) int pcmax; @@ -643,7 +641,6 @@ typedef struct { /// total amount of data awaiting for this UE uint32_t num_total_bytes; - uint16_t dl_pdus_total; /// per-LC status data mac_rlc_status_resp_t rlc_status[NR_MAX_NUM_LCID]; @@ -656,10 +653,8 @@ typedef struct { bool ta_apply; uint8_t tpc0; uint8_t tpc1; - int raw_rssi; int pusch_snrx10; int pucch_snrx10; - uint16_t ul_rssi; int pusch_consecutive_dtx_cnt; int pucch_consecutive_dtx_cnt; bool ul_failure;