Skip to contentSkip to conversation

watchlist: Remove unused APIs

PATCH Applied Denis Kenzior 1 participant 2 messages May 29, 2024 – May 30, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchlist: Remove unused APIs

watchlist_new and watchlist_free were never used. Get rid of them.

---
 src/watchlist.c | 17 -----------------
 src/watchlist.h |  2 --
 2 files changed, 19 deletions(-)
src/watchlist.c +0 -17
index c73169bc446f..899b983e65fe 100644
@@ -48,16 +48,6 @@ static void watchlist_item_free(struct watchlist *watchlist,
 		l_free(item);
 }
 
-struct watchlist *watchlist_new(const struct watchlist_ops *ops)
-{
-	struct watchlist *watchlist;
-
-	watchlist = l_new(struct watchlist, 1);
-	watchlist->items = l_queue_new();
-	watchlist->ops = ops;
-	return watchlist;
-}
-
 void watchlist_init(struct watchlist *watchlist,
 					const struct watchlist_ops *ops)
 {
@@ -137,13 +127,6 @@ void watchlist_destroy(struct watchlist *watchlist)
 	watchlist->items = NULL;
 }
 
-void watchlist_free(struct watchlist *watchlist)
-{
-	watchlist_clear(watchlist);
-	l_queue_destroy(watchlist->items, NULL);
-	l_free(watchlist);
-}
-
 void __watchlist_prune_stale(struct watchlist *watchlist)
 {
 	struct watchlist_item *item;
src/watchlist.h +0 -2
index 7f5f557a2458..8ceedcefe64e 100644
@@ -42,7 +42,6 @@ struct watchlist {
 	const struct watchlist_ops *ops;
 };
 
-struct watchlist *watchlist_new(const struct watchlist_ops *ops);
 void watchlist_init(struct watchlist *watchlist,
 					const struct watchlist_ops *ops);
 unsigned int watchlist_add(struct watchlist *watchlist, void *notify,
@@ -54,7 +53,6 @@ unsigned int watchlist_link(struct watchlist *watchlist,
 					watchlist_item_destroy_func_t destroy);
 bool watchlist_remove(struct watchlist *watchlist, unsigned int id);
 void watchlist_destroy(struct watchlist *watchlist);
-void watchlist_free(struct watchlist *watchlist);
 
 void __watchlist_prune_stale(struct watchlist *watchlist);
 
Signature · 1 line
2.45.0
author Applied
#1 lore raw
Quoted 6 lines · Denis Kenzior

watchlist_new and watchlist_free were never used. Get rid of them.

---
  src/watchlist.c | 17 -----------------
  src/watchlist.h |  2 --
  2 files changed, 19 deletions(-)

Applied.