summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2017-02-07 13:05:17 -0600
committerZane C. Shelley <zshelle@us.ibm.com>2017-02-10 17:34:14 -0500
commit0b0e9f9ab1be3260c157bd2b3dc34ab3ed15e8d5 (patch)
treef9b5d11b709bab25907c37e6c325351f02f1bfe9 /src/usr/diag/prdf/common
parentaaacd79d799b9b99ab66505c23fc65b898550874 (diff)
downloadtalos-hostboot-0b0e9f9ab1be3260c157bd2b3dc34ab3ed15e8d5.tar.gz
talos-hostboot-0b0e9f9ab1be3260c157bd2b3dc34ab3ed15e8d5.zip
PRD: cleaned error path handling in various getConnected() functions
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>
Diffstat (limited to 'src/usr/diag/prdf/common')
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/prdfTargetServices.C33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.C b/src/usr/diag/prdf/common/plat/prdfTargetServices.C
index c7459e20a..2df0150d4 100755
--- a/src/usr/diag/prdf/common/plat/prdfTargetServices.C
+++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.C
@@ -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;
}
@@ -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 )
@@ -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;
OpenPOWER on IntegriCloud