constify state pointers of struct gsm_nm_state

This makes sure code accessing those fields is not changing its values,
since it would make no sense to change those. Follow up commit will make
convert those pointers to be full structs instead, as there's no need to
have pointers there.

Change-Id: I9979e62eac861e25bbe2161ab187ddb2b40fd097
This commit is contained in:
Pau Espin 2022-05-04 16:09:59 +02:00
parent 7cedfd4a44
commit 7d621e0a79
10 changed files with 43 additions and 43 deletions

View File

@ -131,8 +131,8 @@ struct nm_statechg_signal_data {
struct gsm_bts *bts;
uint8_t obj_class;
void *obj;
struct gsm_nm_state *old_state;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *old_state;
const struct gsm_nm_state *new_state;
/* This pointer is valid for TS 12.21 MO */
struct abis_om_obj_inst *obj_inst;

View File

@ -340,7 +340,7 @@ static int print_attr_rep(struct msgb *mb)
}
static int nm_state_event(int evt, uint8_t obj_class, void *obj,
struct gsm_nm_state *old_state, struct gsm_nm_state *new_state,
const struct gsm_nm_state *old_state, const struct gsm_nm_state *new_state,
struct abis_om_obj_inst *obj_inst);
static int nm_sig_cb(unsigned int subsys, unsigned int signal,
@ -677,7 +677,7 @@ out_err:
}
static int nm_state_event(int evt, uint8_t obj_class, void *obj,
struct gsm_nm_state *old_state, struct gsm_nm_state *new_state,
const struct gsm_nm_state *old_state, const struct gsm_nm_state *new_state,
struct abis_om_obj_inst *obj_inst)
{
if (obj_class == NM_OC_BASEB_TRANSC) {

View File

@ -57,7 +57,7 @@ static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint3
static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SW_ACT_REP:
@ -86,7 +86,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
}
}
static void configure_loop(struct gsm_bts_bb_trx *bb_transc, struct gsm_nm_state *state, bool allow_opstart)
static void configure_loop(struct gsm_bts_bb_trx *bb_transc, const struct gsm_nm_state *state, bool allow_opstart)
{
struct gsm_bts_trx *trx = gsm_bts_bb_trx_get_trx(bb_transc);
@ -139,7 +139,7 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event,
{
struct gsm_bts_bb_trx *bb_transc = (struct gsm_bts_bb_trx *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_GET_ATTR_REP:
@ -189,7 +189,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
struct gsm_bts_bb_trx *bb_transc = (struct gsm_bts_bb_trx *)fi->priv;
struct gsm_bts_trx *trx = gsm_bts_bb_trx_get_trx(bb_transc);
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_GET_ATTR_REP:
@ -248,7 +248,7 @@ static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:

View File

@ -59,7 +59,7 @@ static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint3
static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SW_ACT_REP:
@ -88,7 +88,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
}
}
static void configure_loop(struct gsm_bts *bts, struct gsm_nm_state *state, bool allow_opstart)
static void configure_loop(struct gsm_bts *bts, const struct gsm_nm_state *state, bool allow_opstart)
{
struct msgb *msgb;
@ -164,7 +164,7 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event,
{
struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_GET_ATTR_REP:
@ -216,7 +216,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
{
struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_GET_ATTR_REP:
@ -280,7 +280,7 @@ static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:

View File

@ -57,7 +57,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv;
struct gsm_bts *bts = gsm_bts_sm_get_bts(site_mgr);
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SW_ACT_REP:
@ -102,7 +102,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:
@ -142,7 +142,7 @@ static void st_op_disabled_offline_on_enter(struct osmo_fsm_inst *fi, uint32_t p
static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:
@ -173,7 +173,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:

View File

@ -58,7 +58,7 @@ static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint3
static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SW_ACT_REP:
@ -87,7 +87,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
}
}
static void configure_loop(struct gsm_bts_trx_ts *ts, struct gsm_nm_state *state, bool allow_opstart)
static void configure_loop(struct gsm_bts_trx_ts *ts, const struct gsm_nm_state *state, bool allow_opstart)
{
enum abis_nm_chan_comb ccomb;
struct gsm_bts_trx *trx = ts->trx;
@ -128,7 +128,7 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event,
{
struct gsm_bts_trx_ts *ts = (struct gsm_bts_trx_ts *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SET_ATTR_ACK:
@ -177,7 +177,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
{
struct gsm_bts_trx_ts *ts = (struct gsm_bts_trx_ts *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SET_ATTR_ACK:
@ -236,7 +236,7 @@ static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:

View File

@ -57,7 +57,7 @@ static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint3
static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SW_ACT_REP:
@ -86,7 +86,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
}
}
static void configure_loop(struct gsm_gprs_cell *cell, struct gsm_nm_state *state, bool allow_opstart)
static void configure_loop(struct gsm_gprs_cell *cell, const struct gsm_nm_state *state, bool allow_opstart)
{
struct msgb *msgb;
struct gsm_bts *bts = container_of(cell, struct gsm_bts, gprs.cell);
@ -138,7 +138,7 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event,
{
struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SET_ATTR_ACK:
@ -188,7 +188,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
struct gsm_bts *bts = container_of(cell, struct gsm_bts, gprs.cell);
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SET_ATTR_ACK:
@ -247,7 +247,7 @@ static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:

View File

@ -58,7 +58,7 @@ static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint3
static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SW_ACT_REP:
@ -87,7 +87,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
}
}
static void configure_loop(struct gsm_gprs_nse *nse, struct gsm_nm_state *state, bool allow_opstart)
static void configure_loop(struct gsm_gprs_nse *nse, const struct gsm_nm_state *state, bool allow_opstart)
{
struct msgb *msgb;
struct gsm_bts_sm *bts_sm = container_of(nse, struct gsm_bts_sm, gprs.nse);
@ -139,7 +139,7 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event,
{
struct gsm_gprs_nse *nse = (struct gsm_gprs_nse *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SET_ATTR_ACK:
@ -189,7 +189,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
struct gsm_gprs_nse *nse = (struct gsm_gprs_nse *)fi->priv;
struct gsm_bts_sm *bts_sm = container_of(nse, struct gsm_bts_sm, gprs.nse);
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SET_ATTR_ACK:
@ -248,7 +248,7 @@ static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:

View File

@ -59,7 +59,7 @@ static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint3
static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_FEATURE_NEGOTIATED:
@ -90,7 +90,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
}
}
static void configure_loop(struct gsm_gprs_nsvc *nsvc, struct gsm_nm_state *state, bool allow_opstart)
static void configure_loop(struct gsm_gprs_nsvc *nsvc, const struct gsm_nm_state *state, bool allow_opstart)
{
struct msgb *msgb;
@ -151,7 +151,7 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event,
{
struct gsm_gprs_nsvc *nsvc = (struct gsm_gprs_nsvc *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_FEATURE_NEGOTIATED:
@ -203,7 +203,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
{
struct gsm_gprs_nsvc *nsvc = (struct gsm_gprs_nsvc *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_FEATURE_NEGOTIATED:
@ -265,7 +265,7 @@ static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP:

View File

@ -57,7 +57,7 @@ static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint3
static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SW_ACT_REP:
@ -86,7 +86,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
}
}
static void configure_loop(struct gsm_bts_trx *trx, struct gsm_nm_state *state, bool allow_opstart)
static void configure_loop(struct gsm_bts_trx *trx, const struct gsm_nm_state *state, bool allow_opstart)
{
struct msgb *msgb;
@ -134,7 +134,7 @@ static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event,
{
struct gsm_bts_trx *trx = (struct gsm_bts_trx *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SET_ATTR_ACK:
@ -183,7 +183,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
{
struct gsm_bts_trx *trx = (struct gsm_bts_trx *)fi->priv;
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_SET_ATTR_ACK:
@ -233,7 +233,7 @@ static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state
static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct nm_statechg_signal_data *nsd;
struct gsm_nm_state *new_state;
const struct gsm_nm_state *new_state;
switch (event) {
case NM_EV_STATE_CHG_REP: