From 09675f654424497c7d7b03fbfb1469c545d99a97 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 10 Jul 2024 17:16:44 +0200 Subject: [PATCH] get_default_secondaryCellGroup(): make servingCellConfig const We simply don't need to modify the servingCellConfig, so don't do it. --- openair2/RRC/NR/nr_rrc_config.c | 8 +------- openair2/RRC/NR/nr_rrc_config.h | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 8cbf3d8adb..597dba1cdd 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -3040,7 +3040,7 @@ static NR_ServingCellConfigCommon_t *clone_ServingCellConfigCommon(const NR_Serv } NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigCommon_t *servingcellconfigcommon, - NR_ServingCellConfig_t *servingcellconfigdedicated, + const NR_ServingCellConfig_t *servingcellconfigdedicated, const NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, @@ -3058,7 +3058,6 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC LOG_E(RRC, "No UE Capabilities available when programming default CellGroup in NSA\n"); uint64_t bitmap = get_ssb_bitmap(servingcellconfigcommon); - // See comment at the end of this function regarding ServingCellConfig NR_CellGroupConfig_t *secondaryCellGroup = calloc(1, sizeof(*secondaryCellGroup)); secondaryCellGroup->cellGroupId = scg_id; @@ -3362,11 +3361,6 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC secondaryCellGroup->spCellConfig->spCellConfigDedicated->pathlossReferenceLinking = NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->servingCellMO = NULL; - // this is pure evil: We should only pass in a ServingCellConfig, without - // modifying it! TODO: make a separate function that creates a - // ServingCellConfig, and reuse it here - *servingcellconfigdedicated = *secondaryCellGroup->spCellConfig->spCellConfigDedicated; - if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_NR_SpCellConfig, (void *)secondaryCellGroup->spCellConfig); } diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index d46363c707..e3f4fed7cb 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -91,7 +91,7 @@ NR_CellGroupConfig_t *decode_cellGroupConfig(const uint8_t *buffer, int max_buff * configuration, but it will also overwrite the ServingCellConfig passed in * parameter servingcellconfigdedicated! */ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigCommon_t *servingcellconfigcommon, - NR_ServingCellConfig_t *servingcellconfigdedicated, + const NR_ServingCellConfig_t *servingcellconfigdedicated, const NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex,