diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-05-04 16:17:04 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-05-06 14:50:24 +0200 |
commit | b978d1582f948871709acc6d606fbc3b60f0bf01 (patch) | |
tree | 268284e797e17c4322b924dd50acb43ae9cfd81d /src/osmo-bsc/nm_bb_transc_fsm.c | |
parent | 7b36d0b0a0d87a80160f6c2398ea7bb7ff0ccd67 (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_bb_transc_fsm.c')
-rw-r--r-- | src/osmo-bsc/nm_bb_transc_fsm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/osmo-bsc/nm_bb_transc_fsm.c b/src/osmo-bsc/nm_bb_transc_fsm.c index dc8c68228..a4cef9cdf 100644 --- a/src/osmo-bsc/nm_bb_transc_fsm.c +++ b/src/osmo-bsc/nm_bb_transc_fsm.c @@ -64,7 +64,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_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED); @@ -149,7 +149,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_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED); @@ -199,7 +199,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_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED); return; @@ -253,7 +253,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 */ |