This function is not called anywhere outside of the quadtree.c, so
there is no really point in keeping it in the header. Furthermore,
this is one quite big function to keep inlined. Make it an ordinary
static function instead and let the compiler decide whether it should
be inlined or not.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
return new;
}
+/*
+ * Recursively walk through the tree and propagate changes made to the
+ * given node up until the highest parent.
+ */
+static void quadtree_recalculate_parent_stats(struct quadtree *node,
+ struct quadtree_ops *ops)
+{
+ int i;
+
+ while (node) {
+ node->depth = 0;
+ node->children = 0;
+
+ for (i = 0; i < 4; i++) {
+ if (!node->child[i])
+ continue;
+
+ node->depth = MAX(node->depth,
+ node->child[i]->depth + 1);
+ node->children += node->child[i]->children + 1;
+ }
+
+ if (ops->recalculate_stats)
+ ops->recalculate_stats(node);
+
+ node = node->parent;
+ }
+}
+
/**
* quadtree_add - add a node to a quadtree
* @parent: parent node
return t;
}
-/*
- * Recursively walk through the tree and propagate changes made to the
- * given node up until the highest parent.
- */
-static inline void quadtree_recalculate_parent_stats(struct quadtree *node,
- struct quadtree_ops *ops)
-{
- int i;
-
- while (node) {
- node->depth = 0;
- node->children = 0;
-
- for (i = 0; i < 4; i++) {
- if (!node->child[i])
- continue;
-
- node->depth = MAX(node->depth,
- node->child[i]->depth + 1);
- node->children += node->child[i]->children + 1;
- }
-
- if (ops->recalculate_stats)
- ops->recalculate_stats(node);
-
- node = node->parent;
- }
-}
-
#endif