aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/acc.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-05-04 16:17:04 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2022-05-06 14:50:24 +0200
commitb978d1582f948871709acc6d606fbc3b60f0bf01 (patch)
tree268284e797e17c4322b924dd50acb43ae9cfd81d /src/osmo-bsc/acc.c
parent7b36d0b0a0d87a80160f6c2398ea7bb7ff0ccd67 (diff)
nm_statechg_signal_data: Convert state ptr to data
There's no need to use pointers there, it is only asking for errors from code handling the data structe from the signal by attempting to change them. Even for mem size point of view it doesn't make sense, since it's 3 byte vs a 4 byte pointer. Furthermore, this is a preparation for new commit, where the NM object current state will be updated before emitting the signal. This patch eases a lot the follow up mentioned patch. Change-Id: I9b648dfd8392b7b40bfe2b38f3345017481f5129
Diffstat (limited to 'src/osmo-bsc/acc.c')
-rw-r--r--src/osmo-bsc/acc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/osmo-bsc/acc.c b/src/osmo-bsc/acc.c
index 1172fd898..61a226c53 100644
--- a/src/osmo-bsc/acc.c
+++ b/src/osmo-bsc/acc.c
@@ -427,11 +427,11 @@ static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void *ha
trx = nsd->obj;
LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: administrative state %s -> %s\n",
- get_value_string(abis_nm_adm_state_names, nsd->old_state->administrative),
- get_value_string(abis_nm_adm_state_names, nsd->new_state->administrative));
+ get_value_string(abis_nm_adm_state_names, nsd->old_state.administrative),
+ get_value_string(abis_nm_adm_state_names, nsd->new_state.administrative));
LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: operational state %s -> %s\n",
- abis_nm_opstate_name(nsd->old_state->operational),
- abis_nm_opstate_name(nsd->new_state->operational));
+ abis_nm_opstate_name(nsd->old_state.operational),
+ abis_nm_opstate_name(nsd->new_state.operational));
/* We only care about state changes of the first TRX. */
if (trx->nr != 0)
@@ -445,21 +445,21 @@ static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void *ha
}
/* Trigger or abort ACC ramping based on the new state of this TRX. */
- if (nsd->old_state->administrative != nsd->new_state->administrative) {
- switch (nsd->new_state->administrative) {
+ if (nsd->old_state.administrative != nsd->new_state.administrative) {
+ switch (nsd->new_state.administrative) {
case NM_STATE_UNLOCKED:
- if (nsd->old_state->operational != nsd->new_state->operational) {
+ if (nsd->old_state.operational != nsd->new_state.operational) {
/*
* Administrative and operational state have both changed.
* Trigger ramping only if TRX 0 will be both enabled and unlocked.
*/
- if (nsd->new_state->operational == NM_OPSTATE_ENABLED)
+ if (nsd->new_state.operational == NM_OPSTATE_ENABLED)
trigger_ramping = true;
else
LOG_TRX(trx, DRSL, LOGL_DEBUG,
"ACC RAMP: ignoring state change because TRX is "
"transitioning into operational state '%s'\n",
- abis_nm_opstate_name(nsd->new_state->operational));
+ abis_nm_opstate_name(nsd->new_state.operational));
} else {
/*
* Operational state has not changed.
@@ -479,24 +479,24 @@ static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void *ha
case NM_STATE_NULL:
default:
LOG_TRX(trx, DRSL, LOGL_ERROR, "ACC RAMP: unrecognized administrative state '0x%x' "
- "reported for TRX 0\n", nsd->new_state->administrative);
+ "reported for TRX 0\n", nsd->new_state.administrative);
break;
}
}
- if (nsd->old_state->operational != nsd->new_state->operational) {
- switch (nsd->new_state->operational) {
+ if (nsd->old_state.operational != nsd->new_state.operational) {
+ switch (nsd->new_state.operational) {
case NM_OPSTATE_ENABLED:
- if (nsd->old_state->administrative != nsd->new_state->administrative) {
+ if (nsd->old_state.administrative != nsd->new_state.administrative) {
/*
* Administrative and operational state have both changed.
* Trigger ramping only if TRX 0 will be both enabled and unlocked.
*/
- if (nsd->new_state->administrative == NM_STATE_UNLOCKED)
+ if (nsd->new_state.administrative == NM_STATE_UNLOCKED)
trigger_ramping = true;
else
LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: ignoring state change "
"because TRX is transitioning into administrative state '%s'\n",
- get_value_string(abis_nm_adm_state_names, nsd->new_state->administrative));
+ get_value_string(abis_nm_adm_state_names, nsd->new_state.administrative));
} else {
/*
* Administrative state has not changed.
@@ -516,7 +516,7 @@ static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void *ha
case NM_OPSTATE_NULL:
default:
LOG_TRX(trx, DRSL, LOGL_ERROR, "ACC RAMP: unrecognized operational state '0x%x' "
- "reported for TRX 0\n", nsd->new_state->administrative);
+ "reported for TRX 0\n", nsd->new_state.administrative);
break;
}
}