Skip to content

Commit

Permalink
PRD: cleaned error path handling in various getConnected() functions
Browse files Browse the repository at this point in the history
Change-Id: I6488a7233e9142027fdd18ee582131f681f2a21d
RTC: 168856
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36053
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36080
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Feb 10, 2017
1 parent aaacd79 commit 0b0e9f9
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions src/usr/diag/prdf/common/plat/prdfTargetServices.C
Expand Up @@ -600,18 +600,15 @@ TargetHandleList getConnected( TargetHandle_t i_target, TYPE i_connType )

TargetHandleList o_list; // Default empty list

do
if ( getTargetType(i_target) == i_connType )
{
o_list.push_back( i_target );
}
else
{
if ( i_connType == getTargetType(i_target) )
{
o_list.push_back( i_target );
break;
}

o_list = getConnAssoc( i_target, i_connType,
getAssociationType(i_target, i_connType) );

} while(0);
}

return o_list;
}
Expand Down Expand Up @@ -669,22 +666,15 @@ TargetHandle_t getConnectedChild( TargetHandle_t i_target, TYPE i_connType,
PRDF_ASSERT(false);
}

do
// Get the list.
TargetHandleList list = getConnAssoc( i_target, i_connType, assocType );
if ( !list.empty() )
{
// Get the list.
TargetHandleList list = getConnAssoc( i_target, i_connType, assocType );
if ( list.empty() )
{
PRDF_ERR( PRDF_FUNC "The list is empty: i_target=0x%08x "
"i_connType=%d", getHuid(i_target), i_connType );
break;
}

// There are some special cases where we need something other than to
// match the unit positions. So check those first.

TargetHandleList::iterator itr = list.end();
TYPE trgtType = getTargetType( i_target );
TYPE trgtType = getTargetType( i_target );
uint32_t trgtPos = getTargetPosition( i_target );

if ( TYPE_EQ == trgtType && TYPE_EX == i_connType )
Expand Down Expand Up @@ -810,8 +800,7 @@ TargetHandle_t getConnectedChild( TargetHandle_t i_target, TYPE i_connType,
// Get the target if found.
if ( list.end() != itr )
o_child = *itr;

} while(0);
}

return o_child;

Expand Down

0 comments on commit 0b0e9f9

Please sign in to comment.