From f9993836ed0cb0359e486daa50f72c889f81a36a Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 4 Aug 2011 11:58:56 -0400 Subject: [PATCH] Remove write-only variables in lib/cache.c --- lib/cache.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/cache.c b/lib/cache.c index 3b453a9..90c0c0f 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -67,15 +67,12 @@ int nl_cache_nitems(struct nl_cache *cache) */ int nl_cache_nitems_filter(struct nl_cache *cache, struct nl_object *filter) { - struct nl_object_ops *ops; struct nl_object *obj; int nitems = 0; if (cache->c_ops == NULL) BUG(); - ops = cache->c_ops->co_obj_ops; - nl_list_for_each_entry(obj, &cache->c_items, ce_list) { if (filter && !nl_object_match_filter(obj, filter)) continue; @@ -271,7 +268,6 @@ struct nl_cache *nl_cache_subset(struct nl_cache *orig, struct nl_object *filter) { struct nl_cache *cache; - struct nl_object_ops *ops; struct nl_object *obj; if (!filter) @@ -281,8 +277,6 @@ struct nl_cache *nl_cache_subset(struct nl_cache *orig, if (!cache) return NULL; - ops = orig->c_ops->co_obj_ops; - nl_list_for_each_entry(obj, &orig->c_items, ce_list) { if (!nl_object_match_filter(obj, filter)) continue; @@ -941,13 +935,10 @@ void nl_cache_foreach_filter(struct nl_cache *cache, struct nl_object *filter, void (*cb)(struct nl_object *, void *), void *arg) { struct nl_object *obj, *tmp; - struct nl_object_ops *ops; if (cache->c_ops == NULL) BUG(); - ops = cache->c_ops->co_obj_ops; - nl_list_for_each_entry_safe(obj, tmp, &cache->c_items, ce_list) { if (filter) { int diff = nl_object_match_filter(obj, filter); -- 2.40.0