FreeBSD/sys/kern/subr_smp.c
/*
 * Iterate to the next node in the depth-first search (traversal) of
 * the topology tree.
 */
Iterate to the next node in the depth-first search (traversal) of
the topology tree.
Iterate to the next node in the depth - first search ( traversal ) of the topology tree .
struct topo_node *
topo_next_node(struct topo_node *top, struct topo_node *node)
{
	struct topo_node *next;
	if ((next = TAILQ_FIRST(&node->children)) != NULL)
		return (next);
	if ((next = TAILQ_NEXT(node, siblings)) != NULL)
		return (next);
	while ((node = node->parent) != top)
		if ((next = TAILQ_NEXT(node, siblings)) != NULL)
			return (next);
	return (NULL);
}
struct topo_node * topo_next_node ( struct topo_node * top , struct topo_node * node ) { struct topo_node * next ; if ( ( next = TAILQ_FIRST ( & node -> children ) ) != NULL ) return ( next ) ; if ( ( next = TAILQ_NEXT ( node , siblings ) ) != NULL ) return ( next ) ; while ( ( node = node -> parent ) != top ) if ( ( next = TAILQ_NEXT ( node , siblings ) ) != NULL ) return ( next ) ; return ( NULL ) ; }
Iterate to the next node in the depth-first search (traversal) of
 the topology tree.
Iterate to the next node in the depth - first search ( traversal ) of the topology tree .