laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/19404 )

Change subject: common: Avoid call to bts_model_chg_adm_state() if there's no 
ADM state change
......................................................................

common: Avoid call to bts_model_chg_adm_state() if there's no ADM state change

Let's handle it in common code to simplify and avoid duplication in
model specific code.

Change-Id: Icea3ea1108d360193cac478f366be97ff38246d4
---
M src/common/oml.c
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/common/oml.c b/src/common/oml.c
index 1be4f89..39304f1 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1032,13 +1032,14 @@
                return oml_fom_ack_nack(msg, NM_NACK_OBJINST_UNKN);

        /* Step 2: Do some global dependency/consistency checking */
-       if (mo->nm_state.administrative == adm_state)
+       if (mo->nm_state.administrative == adm_state) {
                LOGPFOH(DOML, LOGL_NOTICE, foh, "ADM state already was %s\n",
                        get_value_string(abis_nm_adm_state_names, adm_state));
-       else
-               LOGPFOH(DOML, LOGL_NOTICE, foh, "ADM STATE %s -> %s\n",
-                       get_value_string(abis_nm_adm_state_names, 
mo->nm_state.administrative),
-                       get_value_string(abis_nm_adm_state_names, adm_state));
+               return oml_mo_statechg_ack(mo);
+       }
+       LOGPFOH(DOML, LOGL_NOTICE, foh, "ADM STATE %s -> %s\n",
+               get_value_string(abis_nm_adm_state_names, 
mo->nm_state.administrative),
+               get_value_string(abis_nm_adm_state_names, adm_state));

        /* Step 3: Ask BTS driver to apply the state chg */
        return bts_model_chg_adm_state(bts, mo, obj, adm_state);

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/19404
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icea3ea1108d360193cac478f366be97ff38246d4
Gerrit-Change-Number: 19404
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Hoernchen <ew...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to