pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/31096 )
Change subject: Mark *_fsm_timeouts as static ......................................................................
Mark *_fsm_timeouts as static
After some earlier refactoring, those fields are only used internally in the module, and hence can be marked as static.
Change-Id: Ibf2a6ee5636ae7102ffd13b7497769652bcc3202 --- M src/tbf_dl_ass_fsm.c M src/tbf_dl_ass_fsm.h M src/tbf_dl_fsm.c M src/tbf_ul_ack_fsm.c M src/tbf_ul_ack_fsm.h M src/tbf_ul_ass_fsm.c M src/tbf_ul_ass_fsm.h M src/tbf_ul_fsm.c 8 files changed, 32 insertions(+), 35 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/31096/1
diff --git a/src/tbf_dl_ass_fsm.c b/src/tbf_dl_ass_fsm.c index dec7042..d5e3646 100644 --- a/src/tbf_dl_ass_fsm.c +++ b/src/tbf_dl_ass_fsm.c @@ -31,7 +31,7 @@
#define X(s) (1 << (s))
-const struct osmo_tdef_state_timeout tbf_dl_ass_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout tbf_dl_ass_fsm_timeouts[32] = { [TBF_DL_ASS_NONE] = {}, [TBF_DL_ASS_SEND_ASS] = {}, [TBF_DL_ASS_WAIT_ACK] = {}, @@ -45,6 +45,15 @@ { 0, NULL } };
+/* Transition to a state, using the T timer defined in tbf_dl_ass_fsm_timeouts. + * The actual timeout value is in turn obtained from conn->T_defs. + * Assumes local variable fi exists. */ +#define tbf_dl_ass_fsm_state_chg(fi, NEXT_STATE) \ + osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \ + tbf_dl_ass_fsm_timeouts, \ + the_pcu->T_defs, \ + -1) + struct msgb *create_packet_dl_assign(const struct tbf_dl_ass_fsm_ctx *ctx, const struct tbf_dl_ass_ev_create_rlcmac_msg_ctx *d) { diff --git a/src/tbf_dl_ass_fsm.h b/src/tbf_dl_ass_fsm.h index b0000ca..cb7be8d 100644 --- a/src/tbf_dl_ass_fsm.h +++ b/src/tbf_dl_ass_fsm.h @@ -41,16 +41,6 @@ struct gprs_rlcmac_tbf* tbf; /* back pointer */ };
-extern const struct osmo_tdef_state_timeout tbf_dl_ass_fsm_timeouts[32]; -/* Transition to a state, using the T timer defined in tbf_dl_ass_fsm_timeouts. - * The actual timeout value is in turn obtained from conn->T_defs. - * Assumes local variable fi exists. */ -#define tbf_dl_ass_fsm_state_chg(fi, NEXT_STATE) \ - osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \ - tbf_dl_ass_fsm_timeouts, \ - the_pcu->T_defs, \ - -1) - extern struct osmo_fsm tbf_dl_ass_fsm;
diff --git a/src/tbf_dl_fsm.c b/src/tbf_dl_fsm.c index 6b455da..a0b1c03 100644 --- a/src/tbf_dl_fsm.c +++ b/src/tbf_dl_fsm.c @@ -29,7 +29,7 @@
#define X(s) (1 << (s))
-const struct osmo_tdef_state_timeout tbf_dl_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout tbf_dl_fsm_timeouts[32] = { [TBF_ST_NEW] = {}, [TBF_ST_ASSIGN] = { }, [TBF_ST_FLOW] = { }, diff --git a/src/tbf_ul_ack_fsm.c b/src/tbf_ul_ack_fsm.c index e2299d4..264ea9e 100644 --- a/src/tbf_ul_ack_fsm.c +++ b/src/tbf_ul_ack_fsm.c @@ -33,7 +33,7 @@
#define X(s) (1 << (s))
-const struct osmo_tdef_state_timeout tbf_ul_ack_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout tbf_ul_ack_fsm_timeouts[32] = { [TBF_UL_ACK_ST_NONE] = {}, [TBF_UL_ACK_ST_SCHED_UL_ACK] = {}, [TBF_UL_ACK_ST_WAIT_ACK] = {}, @@ -47,6 +47,15 @@ { 0, NULL } };
+/* Transition to a state, using the T timer defined in tbf_ul_ack_fsm_timeouts. + * The actual timeout value is in turn obtained from conn->T_defs. + * Assumes local variable fi exists. */ +#define tbf_ul_ack_fsm_state_chg(fi, NEXT_STATE) \ + osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \ + tbf_ul_ack_fsm_timeouts, \ + the_pcu->T_defs, \ + -1) + static struct msgb *create_ul_ack_nack(const struct tbf_ul_ack_fsm_ctx *ctx, const struct tbf_ul_ack_ev_create_rlcmac_msg_ctx *d, bool final) diff --git a/src/tbf_ul_ack_fsm.h b/src/tbf_ul_ack_fsm.h index d0005eb..3f34f31 100644 --- a/src/tbf_ul_ack_fsm.h +++ b/src/tbf_ul_ack_fsm.h @@ -42,16 +42,6 @@ struct gprs_rlcmac_ul_tbf *tbf; /* back pointer */ };
-extern const struct osmo_tdef_state_timeout tbf_ul_ack_fsm_timeouts[32]; -/* Transition to a state, using the T timer defined in tbf_ul_ack_fsm_timeouts. - * The actual timeout value is in turn obtained from conn->T_defs. - * Assumes local variable fi exists. */ -#define tbf_ul_ack_fsm_state_chg(fi, NEXT_STATE) \ - osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \ - tbf_ul_ack_fsm_timeouts, \ - the_pcu->T_defs, \ - -1) - extern struct osmo_fsm tbf_ul_ack_fsm;
diff --git a/src/tbf_ul_ass_fsm.c b/src/tbf_ul_ass_fsm.c index e15f21c..6c31e1e 100644 --- a/src/tbf_ul_ass_fsm.c +++ b/src/tbf_ul_ass_fsm.c @@ -31,7 +31,7 @@
#define X(s) (1 << (s))
-const struct osmo_tdef_state_timeout tbf_ul_ass_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout tbf_ul_ass_fsm_timeouts[32] = { [TBF_UL_ASS_NONE] = {}, [TBF_UL_ASS_SEND_ASS] = {}, [TBF_UL_ASS_SEND_ASS_REJ] = {}, @@ -48,6 +48,15 @@ { 0, NULL } };
+/* Transition to a state, using the T timer defined in tbf_ul_ass_fsm_timeouts. + * The actual timeout value is in turn obtained from conn->T_defs. + * Assumes local variable fi exists. */ +#define tbf_ul_ass_fsm_state_chg(fi, NEXT_STATE) \ + osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \ + tbf_ul_ass_fsm_timeouts, \ + the_pcu->T_defs, \ + -1) + static struct msgb *create_packet_access_reject(const struct tbf_ul_ass_fsm_ctx *ctx) { struct msgb *msg; diff --git a/src/tbf_ul_ass_fsm.h b/src/tbf_ul_ass_fsm.h index a978e91..28a09dc 100644 --- a/src/tbf_ul_ass_fsm.h +++ b/src/tbf_ul_ass_fsm.h @@ -44,16 +44,6 @@ struct gprs_rlcmac_tbf* tbf; /* back pointer */ };
-extern const struct osmo_tdef_state_timeout tbf_ul_ass_fsm_timeouts[32]; -/* Transition to a state, using the T timer defined in tbf_ul_ass_fsm_timeouts. - * The actual timeout value is in turn obtained from conn->T_defs. - * Assumes local variable fi exists. */ -#define tbf_ul_ass_fsm_state_chg(fi, NEXT_STATE) \ - osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \ - tbf_ul_ass_fsm_timeouts, \ - the_pcu->T_defs, \ - -1) - extern struct osmo_fsm tbf_ul_ass_fsm;
diff --git a/src/tbf_ul_fsm.c b/src/tbf_ul_fsm.c index fb4a256..571c689 100644 --- a/src/tbf_ul_fsm.c +++ b/src/tbf_ul_fsm.c @@ -29,7 +29,7 @@
#define X(s) (1 << (s))
-const struct osmo_tdef_state_timeout tbf_ul_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout tbf_ul_fsm_timeouts[32] = { [TBF_ST_NEW] = {}, [TBF_ST_ASSIGN] = { }, [TBF_ST_FLOW] = { },