summaryrefslogtreecommitdiffstats
path: root/lib/flex_algo.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/flex_algo.c')
-rw-r--r--lib/flex_algo.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/flex_algo.c b/lib/flex_algo.c
index f48117ff..ab0eef67 100644
--- a/lib/flex_algo.c
+++ b/lib/flex_algo.c
@@ -20,9 +20,6 @@
DEFINE_MTYPE_STATIC(LIB, FLEX_ALGO_DATABASE, "Flex-Algo database");
DEFINE_MTYPE_STATIC(LIB, FLEX_ALGO, "Flex-Algo algorithm information");
-static void _flex_algo_delete(struct flex_algos *flex_algos,
- struct flex_algo *fa);
-
struct flex_algos *flex_algos_alloc(flex_algo_allocator_t allocator,
flex_algo_releaser_t releaser)
{
@@ -42,7 +39,7 @@ void flex_algos_free(struct flex_algos *flex_algos)
struct flex_algo *fa;
for (ALL_LIST_ELEMENTS(flex_algos->flex_algos, node, nnode, fa))
- _flex_algo_delete(flex_algos, fa);
+ flex_algo_free(flex_algos, fa);
list_delete(&flex_algos->flex_algos);
XFREE(MTYPE_FLEX_ALGO_DATABASE, flex_algos);
}
@@ -63,8 +60,7 @@ struct flex_algo *flex_algo_alloc(struct flex_algos *flex_algos,
return fa;
}
-static void _flex_algo_delete(struct flex_algos *flex_algos,
- struct flex_algo *fa)
+void flex_algo_free(struct flex_algos *flex_algos, struct flex_algo *fa)
{
if (flex_algos->releaser)
flex_algos->releaser(fa->data);
@@ -75,19 +71,6 @@ static void _flex_algo_delete(struct flex_algos *flex_algos,
XFREE(MTYPE_FLEX_ALGO, fa);
}
-
-void flex_algo_delete(struct flex_algos *flex_algos, uint8_t algorithm)
-{
- struct listnode *node, *nnode;
- struct flex_algo *fa;
-
- for (ALL_LIST_ELEMENTS(flex_algos->flex_algos, node, nnode, fa)) {
- if (fa->algorithm != algorithm)
- continue;
- _flex_algo_delete(flex_algos, fa);
- }
-}
-
/**
* @brief Look up the local flex-algo object by its algorithm number.
* @param algorithm flex-algo algorithm number