summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@ozlabs.org>2018-11-23 15:40:16 +1100
committerAlistair Popple <alistair@popple.id.au>2018-12-03 14:49:27 +1100
commitcc75aa0c64691c3322c8e9cda3a52767d759431d (patch)
treed02932b1aedf43eff7ce48e214c50e4a8d02eceb
parent870878496817f40f2c3695fb0bdb1515dfe0b7fd (diff)
downloadpdbg-cc75aa0c64691c3322c8e9cda3a52767d759431d.tar.gz
pdbg-cc75aa0c64691c3322c8e9cda3a52767d759431d.zip
main: Drop unused iterators with callbacks
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
-rw-r--r--src/main.c61
-rw-r--r--src/main.h8
2 files changed, 0 insertions, 69 deletions
diff --git a/src/main.c b/src/main.c
index d311332..b4aa7f7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -532,67 +532,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);
OpenPOWER on IntegriCloud