aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/nm_bts_fsm.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/nm_bts_fsm.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/nm_bts_fsm.c')
-rw-r--r--src/osmo-bsc/nm_bts_fsm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/osmo-bsc/nm_bts_fsm.c b/src/osmo-bsc/nm_bts_fsm.c
index 5216ec8a4..79ae6a7de 100644
--- a/src/osmo-bsc/nm_bts_fsm.c
+++ b/src/osmo-bsc/nm_bts_fsm.c
@@ -66,7 +66,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/*should not happen... */
nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
@@ -177,7 +177,7 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event,
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
@@ -229,7 +229,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
return;
@@ -285,7 +285,7 @@ static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */