Change in osmo-pcu[master]: pdch_ulc: Create helper API pdch_ulc_release_node

pespin gerrit-no-reply at lists.osmocom.org
Thu Mar 25 15:40:28 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/23491 )

Change subject: pdch_ulc: Create helper API pdch_ulc_release_node
......................................................................

pdch_ulc: Create helper API pdch_ulc_release_node

Change-Id: I6362ad7382c2b73e6fedb11182964be96e5c8d35
---
M src/pdch_ul_controller.c
M src/pdch_ul_controller.h
2 files changed, 9 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  daniel: Looks good to me, approved



diff --git a/src/pdch_ul_controller.c b/src/pdch_ul_controller.c
index cd705d0..f7b2335 100644
--- a/src/pdch_ul_controller.c
+++ b/src/pdch_ul_controller.c
@@ -183,13 +183,18 @@
 	return pdch_ulc_add_node(ulc, item);
 }
 
+void pdch_ulc_release_node(struct pdch_ulc *ulc, struct pdch_ulc_node *item)
+{
+	rb_erase(&item->node, &ulc->tree_root);
+	talloc_free(item);
+}
+
 int pdch_ulc_release_fn(struct pdch_ulc *ulc, uint32_t fn)
 {
 	struct pdch_ulc_node *item = pdch_ulc_get_node(ulc, fn);
 	if (!item)
 		return -ENOKEY;
-	rb_erase(&item->node, &ulc->tree_root);
-	talloc_free(item);
+	pdch_ulc_release_node(ulc, item);
 	return 0;
 }
 
@@ -222,8 +227,7 @@
 			 * search from start (to avoid traverse continue from
 			 * no-more existant node */
 			tree_modified = true;
-			rb_erase(&item->node, &ulc->tree_root);
-			talloc_free(item);
+			pdch_ulc_release_node(ulc, item);
 			break;
 		}
 	} while (tree_modified);
diff --git a/src/pdch_ul_controller.h b/src/pdch_ul_controller.h
index eb93143..731cbe1 100644
--- a/src/pdch_ul_controller.h
+++ b/src/pdch_ul_controller.h
@@ -77,8 +77,8 @@
 struct gprs_rlcmac_sba *pdch_ulc_get_sba(struct pdch_ulc *ulc, uint32_t fn);
 struct gprs_rlcmac_tbf *pdch_ulc_get_tbf_poll(struct pdch_ulc *ulc, uint32_t fn);
 
+void pdch_ulc_release_node(struct pdch_ulc *ulc, struct pdch_ulc_node *item);
 void pdch_ulc_release_tbf(struct pdch_ulc *ulc, const struct gprs_rlcmac_tbf *tbf);
-
 int pdch_ulc_release_fn(struct pdch_ulc *ulc, uint32_t fn);
 
 void pdch_ulc_expire_fn(struct pdch_ulc *ulc, uint32_t fn);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/23491
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I6362ad7382c2b73e6fedb11182964be96e5c8d35
Gerrit-Change-Number: 23491
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210325/37cc7cb7/attachment.htm>


More information about the gerrit-log mailing list