From ff53d2b8b899fee47de2258d224908b8eb144892 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 23 Apr 2021 11:54:45 +0200 Subject: [PATCH] all: set of trivial changes reported by LGTM mainly fixmes, unused/empty code, etc. --- lib/examples/npdsch_ue.c | 2 +- lib/examples/pdsch_ue.c | 1 - lib/include/srsran/common/basic_pnf.h | 2 +- lib/include/srsran/interfaces/ue_nr_interfaces.h | 2 +- lib/src/common/basic_vnf.cc | 2 +- lib/src/phy/phch/pdsch_nr.c | 2 -- lib/src/phy/phch/pusch_nr.c | 2 -- lib/src/upper/pdcp_entity_nr.cc | 2 +- srsenb/src/stack/rrc/rrc_nr.cc | 4 ++-- srsue/src/stack/mac_nr/proc_bsr_nr.cc | 2 ++ srsue/src/stack/mac_nr/ul_harq_nr.cc | 2 +- srsue/src/stack/rrc/rrc_nr.cc | 1 + srsue/test/ttcn3/hdr/ttcn3_helpers.h | 2 +- 13 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/examples/npdsch_ue.c b/lib/examples/npdsch_ue.c index 1a08e7b26..e301f2071 100644 --- a/lib/examples/npdsch_ue.c +++ b/lib/examples/npdsch_ue.c @@ -542,7 +542,7 @@ int main(int argc, char** argv) system_frame_number = (mib.sfn + sfn_offset) % 1024; cell.mode = mib.mode; - // set number of ports of base cell to that of NB-IoT cell (FIXME: read eutra-NumCRS-Ports-r13) + // set number of ports of base cell to that of NB-IoT cell (TODO: read eutra-NumCRS-Ports-r13) cell.base.nof_ports = cell.nof_ports; if (cell.mode == SRSRAN_NBIOT_MODE_INBAND_SAME_PCI) { diff --git a/lib/examples/pdsch_ue.c b/lib/examples/pdsch_ue.c index 083546a52..d4d5662e5 100644 --- a/lib/examples/pdsch_ue.c +++ b/lib/examples/pdsch_ue.c @@ -365,7 +365,6 @@ srsran_ue_sync_t ue_sync; prog_args_t prog_args; uint32_t pkt_errors = 0, pkt_total = 0, nof_detected = 0, pmch_pkt_errors = 0, pmch_pkt_total = 0, nof_trials = 0; -double evm = 0.0; srsran_netsink_t net_sink, net_sink_signal; /* Useful macros for printing lines which will disappear */ diff --git a/lib/include/srsran/common/basic_pnf.h b/lib/include/srsran/common/basic_pnf.h index 8b7003f7b..fdd1f0bb9 100644 --- a/lib/include/srsran/common/basic_pnf.h +++ b/lib/include/srsran/common/basic_pnf.h @@ -193,7 +193,7 @@ private: std::chrono::duration_cast(std::chrono::steady_clock::now() - tti_start_time) .count(); - // FIXME: add averaging + // TODO: add averaging metrics.avg_rtt_us = rtt; } }; diff --git a/lib/include/srsran/interfaces/ue_nr_interfaces.h b/lib/include/srsran/interfaces/ue_nr_interfaces.h index 3b85c0cbd..faed69fa2 100644 --- a/lib/include/srsran/interfaces/ue_nr_interfaces.h +++ b/lib/include/srsran/interfaces/ue_nr_interfaces.h @@ -82,7 +82,7 @@ public: tb_ul_t tb; // only single TB in UL } tb_action_ul_t; - virtual int sf_indication(const uint32_t tti) = 0; ///< FIXME: rename to slot indication + virtual int sf_indication(const uint32_t tti) = 0; ///< TODO: rename to slot indication // Query the MAC for the current RNTI to look for struct sched_rnti_t { diff --git a/lib/src/common/basic_vnf.cc b/lib/src/common/basic_vnf.cc index 81170e633..223d9a9dc 100644 --- a/lib/src/common/basic_vnf.cc +++ b/lib/src/common/basic_vnf.cc @@ -260,7 +260,7 @@ int srsran_basic_vnf::dl_config_request(const srsenb::phy_interface_stack_nr::dl dl_conf.header.msg_len = sizeof(dl_conf) - sizeof(basic_vnf_api::msg_header_t); dl_conf.t1 = last_sf_indication_time; // play back the time - dl_conf.t2 = 0xaa; // FIXME: add timestamp + dl_conf.t2 = 0xaa; // TODO: add timestamp dl_conf.tti = request.tti; dl_conf.beam_id = request.beam_id; diff --git a/lib/src/phy/phch/pdsch_nr.c b/lib/src/phy/phch/pdsch_nr.c index 0f3da4783..307c57a38 100644 --- a/lib/src/phy/phch/pdsch_nr.c +++ b/lib/src/phy/phch/pdsch_nr.c @@ -582,8 +582,6 @@ static uint32_t pdsch_nr_grant_info(const srsran_pdsch_nr_t* q, if (res != NULL) { if (grant->tb[i].enabled && !isnan(res->evm[i])) { len = srsran_print_check(str, str_len, len, "evm=%.2f ", res->evm[i]); - if (i < SRSRAN_MAX_CODEWORDS - 1) { - } } } } diff --git a/lib/src/phy/phch/pusch_nr.c b/lib/src/phy/phch/pusch_nr.c index 1a7bd672c..6a5cc2169 100644 --- a/lib/src/phy/phch/pusch_nr.c +++ b/lib/src/phy/phch/pusch_nr.c @@ -1018,8 +1018,6 @@ static uint32_t pusch_nr_grant_info(const srsran_pusch_nr_t* q, if (res != NULL) { if (grant->tb[i].enabled && !isnan(res->evm[i])) { len = srsran_print_check(str, str_len, len, "evm=%.2f ", res->evm[i]); - if (i < SRSRAN_MAX_CODEWORDS - 1) { - } } } } diff --git a/lib/src/upper/pdcp_entity_nr.cc b/lib/src/upper/pdcp_entity_nr.cc index 55e3628ab..197e7bb75 100644 --- a/lib/src/upper/pdcp_entity_nr.cc +++ b/lib/src/upper/pdcp_entity_nr.cc @@ -139,7 +139,7 @@ void pdcp_entity_nr::write_pdu(unique_byte_buffer_t pdu) // Extract RCVD_SN from header uint32_t rcvd_sn = read_data_header(pdu); - discard_data_header(pdu); // FIXME Check wheather the header is part of integrity check. + discard_data_header(pdu); // TODO: Check wheather the header is part of integrity check. // Extract MAC uint8_t mac[4]; diff --git a/srsenb/src/stack/rrc/rrc_nr.cc b/srsenb/src/stack/rrc/rrc_nr.cc index 84ea649a3..2f66c6ae5 100644 --- a/srsenb/src/stack/rrc/rrc_nr.cc +++ b/srsenb/src/stack/rrc/rrc_nr.cc @@ -36,7 +36,7 @@ int rrc_nr::init(const rrc_nr_cfg_t& cfg_, gtpu = gtpu_; ngap = ngap_; - // FIXME: overwriting because we are not passing config right now + // TODO: overwriting because we are not passing config right now cfg = update_default_cfg(cfg_); // config logging @@ -158,7 +158,7 @@ rrc_nr_cfg_t rrc_nr::update_default_cfg(const rrc_nr_cfg_t& current) cfg_default.nof_sibs = 1; sib2_s& sib2 = cfg_default.sibs[0].set_sib2(); sib2.cell_resel_info_common.q_hyst.value = sib2_s::cell_resel_info_common_s_::q_hyst_opts::db5; - // FIXME: Fill SIB2 values + // TODO: Fill SIB2 values // set loglevel cfg_default.log_level = "debug"; diff --git a/srsue/src/stack/mac_nr/proc_bsr_nr.cc b/srsue/src/stack/mac_nr/proc_bsr_nr.cc index 40980cfc7..e0bbf6ce7 100644 --- a/srsue/src/stack/mac_nr/proc_bsr_nr.cc +++ b/srsue/src/stack/mac_nr/proc_bsr_nr.cc @@ -324,7 +324,9 @@ uint32_t proc_bsr_nr::find_max_priority_lcg_with_data() */ uint8_t proc_bsr_nr::buff_size_bytes_to_field(uint32_t buffer_size, bsr_format_nr_t format) { + // early exit if (buffer_size == 0) { + return 0; } switch (format) { diff --git a/srsue/src/stack/mac_nr/ul_harq_nr.cc b/srsue/src/stack/mac_nr/ul_harq_nr.cc index 827a15cc4..3e101c82d 100644 --- a/srsue/src/stack/mac_nr/ul_harq_nr.cc +++ b/srsue/src/stack/mac_nr/ul_harq_nr.cc @@ -172,7 +172,7 @@ void ul_harq_entity_nr::ul_harq_process_nr::new_grant_ul(const mac_interface_phy if (nof_retx >= max_retx) { logger.info("UL %d: Maximum number of ReTX reached (%d). Discarding TB.", pid, max_retx); if (grant.rnti == harq_entity->mac->get_temp_crnti()) { - // FIXME: signal maxRetx to RA? + // TODO: signal maxRetx to RA? // harq_entity->ra_proc->harq_max_retx(); } reset(); diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index d49cef10b..a1183ad71 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -879,6 +879,7 @@ bool rrc_nr::apply_ul_common_cfg(const asn1::rrc_nr::ul_cfg_common_s& ul_cfg_com } if (ul_cfg_common.init_ul_bwp.pucch_cfg_common_present) { if (ul_cfg_common.init_ul_bwp.pucch_cfg_common.type() == setup_release_c::types_opts::setup) { + logger.info("PUCCH cfg commont setup not handled"); } else { logger.warning("Option pucch_cfg_common not of type setup"); return false; diff --git a/srsue/test/ttcn3/hdr/ttcn3_helpers.h b/srsue/test/ttcn3/hdr/ttcn3_helpers.h index b0ffbfe91..d66287411 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_helpers.h +++ b/srsue/test/ttcn3/hdr/ttcn3_helpers.h @@ -540,7 +540,7 @@ public: Value sfdata(kObjectType); sfdata.AddMember("PduSduList", pdusdulist, resp.GetAllocator()); - // FIXME: Get real no. of TTIs for transmission + // TODO: Get real no. of TTIs for transmission sfdata.AddMember("NoOfTTIs", 1, resp.GetAllocator()); Value uplane(kObjectType);