lib/sw_apps/zynqmp_pmufw/src/pm_power.c
static PmNode* PmPowerDfsGetNext(void)
{
	PmNode* node = NULL;

	while ((NULL != pmDfs.power) || (false == PmPowerStackIsEmpty())) {
		if (NULL == pmDfs.power) {
			PmPowerStackPop(&pmDfs.power, &pmDfs.it);
		}
		if (pmDfs.power->childCnt == pmDfs.it) {
			node = &pmDfs.power->node;
			pmDfs.power = NULL;
			goto done;
		}
		if (NODE_IS_POWER(pmDfs.power->children[pmDfs.it])) {
			PmPowerStackPush(pmDfs.power, pmDfs.it + 1U);
			PmPowerStackPush(pmDfs.power->children[pmDfs.it]->derived, 0U);
			pmDfs.power = NULL;
		} else {
			node = pmDfs.power->children[pmDfs.it];
			pmDfs.it++;
			goto done;
		}
	}

done:
	return node;
}
/**
 * PmPowerDfsGetNext() - Get next node (DFS)
 * @return	Pointer to the next node or NULL if all nodes are visited
 */
Get next node (DFS)
@return      Pointer to the next node or NULL if all nodes are visited
Get next node ( DFS ) @return Pointer to the next node or NULL if all nodes are visited
static PmNode* PmPowerDfsGetNext(void)
{
	PmNode* node = NULL;
	while ((NULL != pmDfs.power) || (false == PmPowerStackIsEmpty())) {
		if (NULL == pmDfs.power) {
			PmPowerStackPop(&pmDfs.power, &pmDfs.it);
		}
		if (pmDfs.power->childCnt == pmDfs.it) {
			node = &pmDfs.power->node;
			pmDfs.power = NULL;
			goto done;
		}
		if (NODE_IS_POWER(pmDfs.power->children[pmDfs.it])) {
			PmPowerStackPush(pmDfs.power, pmDfs.it + 1U);
			PmPowerStackPush(pmDfs.power->children[pmDfs.it]->derived, 0U);
			pmDfs.power = NULL;
		} else {
			node = pmDfs.power->children[pmDfs.it];
			pmDfs.it++;
			goto done;
		}
	}
done:
	return node;
}
static PmNode * PmPowerDfsGetNext ( void ) { PmNode * node = NULL ; while ( ( NULL != pmDfs . power ) || ( false == PmPowerStackIsEmpty ( ) ) ) { if ( NULL == pmDfs . power ) { PmPowerStackPop ( & pmDfs . power , & pmDfs . it ) ; } if ( pmDfs . power -> childCnt == pmDfs . it ) { node = & pmDfs . power -> node ; pmDfs . power = NULL ; goto done ; } if ( NODE_IS_POWER ( pmDfs . power -> children [ pmDfs . it ] ) ) { PmPowerStackPush ( pmDfs . power , pmDfs . it + 1U ) ; PmPowerStackPush ( pmDfs . power -> children [ pmDfs . it ] -> derived , 0U ) ; pmDfs . power = NULL ; } else { node = pmDfs . power -> children [ pmDfs . it ] ; pmDfs . it ++ ; goto done ; } } done : return node ; }
PmPowerDfsGetNext() - Get next node (DFS)
 @return      Pointer to the next node or NULL if all nodes are visited
PmPowerDfsGetNext () - Get next node ( DFS ) @return Pointer to the next node or NULL if all nodes are visited