From f5e74e3dbfc3621016e2c088a7d9a310108d9020 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 10 Sep 2020 13:20:50 +0200 Subject: [PATCH] path: remove path_uses_node() --- include/villas/path.h | 3 --- lib/path.cpp | 19 ------------------- lib/super_node.cpp | 8 +------- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/include/villas/path.h b/include/villas/path.h index 253c145a1..6eef2557b 100644 --- a/include/villas/path.h +++ b/include/villas/path.h @@ -144,9 +144,6 @@ struct vlist * path_output_signals(struct vpath *n); /** Reverse a path */ int path_reverse(struct vpath *p, struct vpath *r); -/** Check if node is used as source or destination of a path. */ -int path_uses_node(struct vpath *p, struct vnode *n); - /** Parse a single path and add it to the global configuration. * * @param cfg A JSON object containing the configuration of the path. diff --git a/lib/path.cpp b/lib/path.cpp index ac256d4ce..b04781736 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -787,25 +787,6 @@ struct vlist * path_output_signals(struct vpath *p) return &p->signals; } -int path_uses_node(struct vpath *p, struct vnode *n) -{ - for (size_t i = 0; i < vlist_length(&p->destinations); i++) { - struct vpath_destination *pd = (struct vpath_destination *) vlist_at(&p->destinations, i); - - if (pd->node == n) - return 0; - } - - for (size_t i = 0; i < vlist_length(&p->sources); i++) { - struct vpath_source *ps = (struct vpath_source *) vlist_at(&p->sources, i); - - if (ps->node == n) - return 0; - } - - return -1; -} - bool path_is_simple(const struct vpath *p) { int ret; diff --git a/lib/super_node.cpp b/lib/super_node.cpp index 210ecbce2..664dc6272 100644 --- a/lib/super_node.cpp +++ b/lib/super_node.cpp @@ -314,17 +314,11 @@ void SuperNode::startPaths() void SuperNode::prepareNodes() { - int ret, refs; + int ret; for (size_t i = 0; i < vlist_length(&nodes); i++) { auto *n = (struct vnode *) vlist_at(&nodes, i); - refs = vlist_count(&paths, (cmp_cb_t) path_uses_node, n); - if (refs <= 0) { - logger->warn("No path is using the node {}. Skipping...", node_name(n)); - n->enabled = false; - } - if (!node_is_enabled(n)) continue;