From 279bd1794afa9353f5069ddfc3c519c9a031fb5d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 3 Jul 2024 12:10:16 +0200 Subject: [PATCH 1/2] Demote logs for NR band and duplex spacing Demote logs to debug: they don't provide that much information, and show periodically in the UE. They are not useful. --- common/utils/nr/nr_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 520dce1ace..d2a38f11c8 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -652,8 +652,7 @@ frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index) else current_type = FDD; - LOG_I(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex); - + LOG_D(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex); return current_type; } @@ -664,7 +663,7 @@ int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index) int32_t delta_duplex = (nr_bandtable[nr_table_idx].ul_min - nr_bandtable[nr_table_idx].dl_min); - LOG_I(NR_MAC, "NR band duplex spacing is %d KHz (nr_bandtable[%d].band = %d)\n", delta_duplex, nr_table_idx, nr_bandtable[nr_table_idx].band); + LOG_D(NR_MAC, "NR band duplex spacing is %d KHz (nr_bandtable[%d].band = %d)\n", delta_duplex, nr_table_idx, nr_bandtable[nr_table_idx].band); return delta_duplex; } From 141577c88bf1efc20a8df66f8f0b803dfc64253e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 3 Jul 2024 12:11:28 +0200 Subject: [PATCH 2/2] Refactor code and make shorter through ternary operator --- common/utils/nr/nr_common.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index d2a38f11c8..2d7e4ce02f 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -644,14 +644,8 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index) { - frame_type_t current_type; int32_t delta_duplex = get_delta_duplex(current_band, scs_index); - - if (delta_duplex == 0) - current_type = TDD; - else - current_type = FDD; - + frame_type_t current_type = delta_duplex == 0 ? TDD : FDD; LOG_D(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex); return current_type; }