neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31627 )
( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: implicitly register osmo_fsm definitions ...................................................................... implicitly register osmo_fsm definitions I'm going to add a regression test that probes lchan_fsm. I noticed that I have to call lchan_fsm_init() for osmo_fsm_register(). Let's make this implicit as we usually do now, to not have to register FSMs in tests. Change-Id: I58760e743c78a370aedc9720f265c0f8da5c2045 --- M include/osmocom/bsc/assignment_fsm.h M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/handover_fsm.h M include/osmocom/bsc/lchan_fsm.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c M src/osmo-bsc/osmo_bsc_main.c M tests/handover/handover_test.c 11 files changed, 18 insertions(+), 25 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/assignment_fsm.h b/include/osmocom/bsc/assignment_fsm.h index 3dffaf2..17f8c4f 100644 --- a/include/osmocom/bsc/assignment_fsm.h +++ b/include/osmocom/bsc/assignment_fsm.h @@ -40,8 +40,6 @@ ASSIGNMENT_EV_CONN_RELEASING, }; -void assignment_fsm_init(void); - int reassignment_request_to_lchan(enum assign_for assign_for, struct gsm_lchan *lchan, struct gsm_lchan *to_lchan, int tsc_set, int tsc); int reassignment_request_to_chan_type(enum assign_for assign_for, struct gsm_lchan *lchan, diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h index b358da6..766d56a 100644 --- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h +++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h @@ -57,8 +57,6 @@ struct assignment_request; struct gsm_lchan; -void bsc_subscr_conn_fsm_init(void); - /* Allocate a subscriber connection and its associated FSM */ struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net); void gscon_update_id(struct gsm_subscriber_connection *conn); diff --git a/include/osmocom/bsc/handover_fsm.h b/include/osmocom/bsc/handover_fsm.h index faec73f..03a8436 100644 --- a/include/osmocom/bsc/handover_fsm.h +++ b/include/osmocom/bsc/handover_fsm.h @@ -55,8 +55,6 @@ const uint8_t *access_delay; }; -void handover_fsm_init(void); - int handover_request(struct handover_out_req *req); void handover_start(struct handover_out_req *req); void handover_start_inter_bsc_in(struct gsm_subscriber_connection *conn, diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h index cc231dc..b179a7f 100644 --- a/include/osmocom/bsc/lchan_fsm.h +++ b/include/osmocom/bsc/lchan_fsm.h @@ -56,8 +56,6 @@ LCHAN_EV_REQUEST_MODE_MODIFY, }; -void lchan_fsm_init(void); - void lchan_fsm_alloc(struct gsm_lchan *lchan); void lchan_release(struct gsm_lchan *lchan, bool do_rr_release, bool err, enum gsm48_rr_cause cause_rr, diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index d382f10..4af4d56 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -364,7 +364,7 @@ } } -void assignment_fsm_init(void) +static __attribute__((constructor)) void assignment_fsm_init(void) { OSMO_ASSERT(osmo_fsm_register(&assignment_fsm) == 0); } diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 9c0fdcf..ebfbe82 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -1208,7 +1208,7 @@ .event_names = gscon_fsm_event_names, }; -void bsc_subscr_conn_fsm_init(void) +static __attribute__((constructor)) void bsc_subscr_conn_fsm_init(void) { OSMO_ASSERT(osmo_fsm_register(&gscon_fsm) == 0); OSMO_ASSERT(osmo_fsm_register(&lcls_fsm) == 0); diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 251ea5b..e8581c5 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -293,7 +293,7 @@ }; } -void handover_fsm_init(void) +static __attribute__((constructor)) void handover_fsm_init(void) { OSMO_ASSERT(osmo_fsm_register(&ho_fsm) == 0); } diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index ab3fbdd..717f9be 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -461,12 +461,9 @@ osmo_fsm_inst_update_id_f(lchan->fi_rtp, lchan->fi->id); } -extern void lchan_rtp_fsm_init(); - -void lchan_fsm_init(void) +static __attribute__((constructor)) void lchan_fsm_init(void) { OSMO_ASSERT(osmo_fsm_register(&lchan_fsm) == 0); - lchan_rtp_fsm_init(); } static void lchan_reset(struct gsm_lchan *lchan); diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 8b61f1e..4cfec54 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -70,7 +70,7 @@ } while (0) /* Called from lchan_fsm_init(), does not need to be visible in lchan_rtp_fsm.h */ -void lchan_rtp_fsm_init(void) +static __attribute__((constructor)) void lchan_rtp_fsm_init(void) { OSMO_ASSERT(osmo_fsm_register(&lchan_rtp_fsm) == 0); } diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 5ad13ca..69f2721 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -924,10 +924,6 @@ /* seed the PRNG */ srand(time(NULL)); - lchan_fsm_init(); - bsc_subscr_conn_fsm_init(); - assignment_fsm_init(); - handover_fsm_init(); lb_init(); acc_ramp_global_init(); paging_global_init(); diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 2c54526..bf91f02 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -1687,11 +1687,6 @@ bsc_vty_init(bsc_gsmnet); ho_test_vty_init(); - lchan_fsm_init(); - bsc_subscr_conn_fsm_init(); - handover_fsm_init(); - assignment_fsm_init(); - ho_set_algorithm(bsc_gsmnet->ho, 2); ho_set_ho_active(bsc_gsmnet->ho, true); ho_set_hodec2_as_active(bsc_gsmnet->ho, true); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I58760e743c78a370aedc9720f265c0f8da5c2045 Gerrit-Change-Number: 31627 Gerrit-PatchSet: 4 Gerrit-Owner: neels <nhofm...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de> Gerrit-Reviewer: laforge <lafo...@osmocom.org> Gerrit-Reviewer: neels <nhofm...@sysmocom.de> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-MessageType: merged