diff mbox series

[6/9] main: Drop unused iterators with callbacks

Message ID 20181120041953.402413-7-amitay@ozlabs.org
State Accepted
Headers show
Series Convert more commands to path based targeting | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Amitay Isaacs Nov. 20, 2018, 4:19 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 src/main.c | 61 ------------------------------------------------------
 src/main.h |  8 -------
 2 files changed, 69 deletions(-)
diff mbox series

Patch

diff --git a/src/main.c b/src/main.c
index 8c83a49..6693349 100644
--- a/src/main.c
+++ b/src/main.c
@@ -529,67 +529,6 @@  bool target_selected(struct pdbg_target *target)
 	return path_target_selected(target);
 }
 
-/* Returns the sum of return codes. This can be used to count how many targets the callback was run on. */
-int for_each_child_target(char *class, struct pdbg_target *parent,
-				 int (*cb)(struct pdbg_target *, uint32_t, uint64_t *, uint64_t *),
-				 uint64_t *arg1, uint64_t *arg2)
-{
-	int rc = 0;
-	struct pdbg_target *target;
-	uint32_t index;
-	enum pdbg_target_status status;
-
-	pdbg_for_each_target(class, parent, target) {
-		if (!target_selected(target))
-			continue;
-
-		index = pdbg_target_index(target);
-		assert(index != -1);
-		status = pdbg_target_status(target);
-		if (status != PDBG_TARGET_ENABLED)
-			continue;
-
-		rc += cb(target, index, arg1, arg2);
-	}
-
-	return rc;
-}
-
-int for_each_target(char *class, int (*cb)(struct pdbg_target *, uint32_t, uint64_t *, uint64_t *), uint64_t *arg1, uint64_t *arg2)
-{
-	struct pdbg_target *target;
-	uint32_t index;
-	enum pdbg_target_status status;
-	int rc = 0;
-
-	pdbg_for_each_class_target(class, target) {
-		if (!target_selected(target))
-			continue;
-
-		index = pdbg_target_index(target);
-		assert(index != -1);
-		status = pdbg_target_status(target);
-		if (status != PDBG_TARGET_ENABLED)
-			continue;
-
-		rc += cb(target, index, arg1, arg2);
-	}
-
-	return rc;
-}
-
-void for_each_target_release(char *class)
-{
-	struct pdbg_target *target;
-
-	pdbg_for_each_class_target(class, target) {
-		if (!target_selected(target))
-			continue;
-
-		pdbg_target_release(target);
-	}
-}
-
 static bool target_selection(void)
 {
 	switch (backend) {
diff --git a/src/main.h b/src/main.h
index b1366d9..a97826c 100644
--- a/src/main.h
+++ b/src/main.h
@@ -30,11 +30,3 @@  static inline bool target_is_disabled(struct pdbg_target *target)
 void target_select(struct pdbg_target *target);
 void target_unselect(struct pdbg_target *target);
 bool target_selected(struct pdbg_target *target);
-
-/* Returns the sum of return codes. This can be used to count how many targets the callback was run on. */
-int for_each_child_target(char *class, struct pdbg_target *parent,
-				 int (*cb)(struct pdbg_target *, uint32_t, uint64_t *, uint64_t *),
-				 uint64_t *arg1, uint64_t *arg2);
-
-int for_each_target(char *class, int (*cb)(struct pdbg_target *, uint32_t, uint64_t *, uint64_t *), uint64_t *arg1, uint64_t *arg2);
-void for_each_target_release(char *class);