pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32160 )
(
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: bts-rbs2k: Simplify osmo_fsm_inst_alloc_child_id() ......................................................................
bts-rbs2k: Simplify osmo_fsm_inst_alloc_child_id()
Change-Id: I5344161e5a65ae9959684f0fda7f8b06cbb447f3 --- M src/osmo-bsc/abis_om2000.c 1 file changed, 13 insertions(+), 13 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 2a653bf..69a86b5 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -68,20 +68,11 @@ { struct osmo_fsm_inst *fi;
- fi = osmo_fsm_inst_alloc(fsm, parent, NULL, parent->log_level, - id ? id : parent->id); - if (!fi) { - /* indicate immediate termination to caller */ - osmo_fsm_inst_dispatch(parent, parent_term_event, NULL); + fi = osmo_fsm_inst_alloc_child(fsm, parent, parent_term_event); + if (!fi) return NULL; - } - - LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); - - fi->proc.parent = parent; - fi->proc.parent_term_event = parent_term_event; - llist_add(&fi->proc.child, &parent->proc.children); - + if (id) + osmo_fsm_inst_update_id_f_sanitize(fi, '-', id); return fi; }