From b8e377d4caf0fbee184ffc674cdd2b6f846280c0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 8 Oct 2023 18:52:19 +0200 Subject: [PATCH] Add single assert to check for validity in code --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 45ff5c7f62..77369c19d5 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2077,6 +2077,7 @@ uint8_t compute_nr_root_seq(NR_RACH_ConfigCommon_t *rach_config, if (NCS == 0) return nb_preambles; else { r = L_ra/NCS; + AssertFatal(r > 0, "bad r: L_ra %d, NCS %d\n", L_ra, NCS); found_sequences = (nb_preambles/r) + (nb_preambles%r!=0); //ceil(nb_preambles/r) LOG_D(MAC, "Computing NR root sequences: found %u sequences\n", found_sequences); return (found_sequences);