Skip to content

Commit 9d94f3c

Browse files
cjengeldcrowell77
authored andcommitted
Clean up a few cppcheck complaints in Hostboot code
Change-Id: I38e2cf92bf0535abe7b37cfc6936122a2e1e36eb Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/133178 Tested-by: Jenkins Server <[email protected]> Tested-by: Jenkins OP Build CI <[email protected]> Tested-by: Jenkins Combined Simics CI <[email protected]> Tested-by: FSP CI Jenkins <[email protected]> Tested-by: Jenkins OP HW <[email protected]> Tested-by: Hostboot CI <[email protected]> Reviewed-by: Deborah L McLemore <[email protected]> Reviewed-by: Matt Derksen <[email protected]> Reviewed-by: Chris Engel <[email protected]> Reviewed-by: Daniel M Crowell <[email protected]>
1 parent 5c7f503 commit 9d94f3c

File tree

12 files changed

+32
-30
lines changed

12 files changed

+32
-30
lines changed

src/build/linker/linker.C

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2011,2020 */
8+
/* Contributors Listed Below - COPYRIGHT 2011,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* [+] Jan Hlavac */
1111
/* */
@@ -861,6 +861,7 @@ bool Object::read_relocation()
861861
s.address = syms[i]->value;
862862
s.base = syms[i]->section->vma;
863863
s.type = 0;
864+
s.addend = 0;
864865

865866
all_symbols.insert(s.name);
866867

@@ -956,6 +957,7 @@ bool Object::read_relocation()
956957
s.name = loc[i]->sym_ptr_ptr[0]->name;
957958
s.address = loc[i]->address;
958959
s.addend = loc[i]->addend;
960+
s.base = 0;
959961
if ((s.name == BFD_ABS_SECTION_NAME) ||
960962
(this->symbols.find(s.name) != this->symbols.end()))
961963
{

src/securerom/inttypes.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -26,7 +26,7 @@
2626
#define uint_fast8_t uint8_t
2727

2828
#ifndef BYTE_ORDER
29-
#error "BYTE_ORDER MUST BE DEFINED"
29+
static_assert(0,"BYTE_ORDER MUST BE DEFINED");
3030
#endif /* #ifndef BYTE_ORDER */
3131

3232
#if BYTE_ORDER == LITTLE_ENDIAN

src/usr/isteps/tod/TodControls.C

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2012,2021 */
8+
/* Contributors Listed Below - COPYRIGHT 2012,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -208,7 +208,7 @@ errlHndl_t TodControls::buildTodDrawers(
208208
if (nullptr == l_pSysTarget)
209209
{
210210
//We should not be reaching here without a valid system target
211-
TOD_ERR_ASSERT("buildTodDrawers: nullptr system target ");
211+
TOD_ERR_ASSERT(false, "buildTodDrawers: nullptr system target ");
212212
break;
213213
}
214214

@@ -250,7 +250,7 @@ errlHndl_t TodControls::buildTodDrawers(
250250
iv_todConfig[i_config].iv_todDrawerList;
251251
if (!l_todDrawerList.empty())
252252
{
253-
TOD_ERR_ASSERT("TOD drawer list must be empty");
253+
TOD_ERR_ASSERT(false, "TOD drawer list must be empty");
254254
break;
255255
}
256256

@@ -1124,13 +1124,13 @@ void TodControls ::setMdmtOfActiveConfig(
11241124
{
11251125
if ( !i_mdmt )
11261126
{
1127-
TOD_ERR_ASSERT("Software error input MDMT must not be nullptr");
1127+
TOD_ERR_ASSERT(false, "Software error input MDMT must not be nullptr");
11281128
break;
11291129
}
11301130

11311131
if ( !i_masterDrawer )
11321132
{
1133-
TOD_ERR_ASSERT("Software error input master drawer must not be "
1133+
TOD_ERR_ASSERT(false, "Software error input master drawer must not be "
11341134
" nullptr");
11351135
break;
11361136
}
@@ -1161,13 +1161,13 @@ errlHndl_t TodControls::setMdmt(const p10_tod_setup_tod_sel i_config,
11611161
{
11621162
if (!i_mdmt)
11631163
{
1164-
TOD_ERR_ASSERT("Software error input MDMT must not be nullptr");
1164+
TOD_ERR_ASSERT(false, "Software error input MDMT must not be nullptr");
11651165
break;
11661166
}
11671167

11681168
if (!i_masterDrawer)
11691169
{
1170-
TOD_ERR_ASSERT("Software error input master drawer must not be "
1170+
TOD_ERR_ASSERT(false, "Software error input master drawer must not be "
11711171
" nullptr");
11721172
break;
11731173
}
@@ -1202,7 +1202,7 @@ bool TodControls::isProcBlackListed (
12021202
{
12031203
if(!i_procTarget)
12041204
{
1205-
TOD_ERR_ASSERT("Input target cannot be nullptr for "
1205+
TOD_ERR_ASSERT(false, "Input target cannot be nullptr for "
12061206
"isProcBlackListed");
12071207
break;
12081208
}
@@ -1212,7 +1212,7 @@ bool TodControls::isProcBlackListed (
12121212
||
12131213
( GETTYPE(i_procTarget) != TARGETING::TYPE_PROC))
12141214
{
1215-
TOD_ERR_ASSERT("Only processor target allowed as input for "
1215+
TOD_ERR_ASSERT(false, "Only processor target allowed as input for "
12161216
" isProcBlackListed ");
12171217
break;
12181218
}
@@ -1271,7 +1271,7 @@ errlHndl_t TodControls::buildGardedTargetsList()
12711271
TARGETING::targetService().getTopLevelTarget(l_pSystemTarget);
12721272
if (!l_pSystemTarget)
12731273
{
1274-
TOD_ERR_ASSERT("System target could not be found");
1274+
TOD_ERR_ASSERT(false, "System target could not be found");
12751275
break;
12761276
}
12771277

src/usr/isteps/tod/TodControls.H

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2012,2020 */
8+
/* Contributors Listed Below - COPYRIGHT 2012,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -609,7 +609,7 @@ private:
609609
{
610610
if ( !i_procTarget )
611611
{
612-
TOD_ERR_ASSERT("Input target cannot be NULL for "
612+
TOD_ERR_ASSERT(false, "Input target cannot be NULL for "
613613
"addProcToBlackList");
614614
}
615615

@@ -618,7 +618,7 @@ private:
618618
||
619619
( GETTYPE(i_procTarget) != TARGETING::TYPE_PROC))
620620
{
621-
TOD_ERR_ASSERT(" Only processor target allowed as input for "
621+
TOD_ERR_ASSERT(false, " Only processor target allowed as input for "
622622
" addProcToBlackList");
623623
}
624624

src/usr/isteps/tod/TodDrawer.C

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2012,2020 */
8+
/* Contributors Listed Below - COPYRIGHT 2012,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -228,7 +228,7 @@ void TodDrawer::addProc(TodProc* i_proc)
228228
}
229229
else
230230
{
231-
TOD_ERR_ASSERT("Code bug! Null Proc Target passed!");
231+
TOD_ERR_ASSERT(false,"Code bug! Null Proc Target passed!");
232232
}
233233
}
234234

src/usr/isteps/tod/TodProc.C

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2012,2021 */
8+
/* Contributors Listed Below - COPYRIGHT 2012,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -76,12 +76,12 @@ TodProc::TodProc(
7676
{
7777
if(!iv_procTarget)
7878
{
79-
TOD_ERR_ASSERT("Target input i_procTarget is nullptr ");
79+
TOD_ERR_ASSERT(false, "Target input i_procTarget is nullptr ");
8080
break;
8181
}
8282
if(!iv_parentDrawer)
8383
{
84-
TOD_ERR_ASSERT("TOD drawer input iv_parentDrawer is nullptr ");
84+
TOD_ERR_ASSERT(false, "TOD drawer input iv_parentDrawer is nullptr ");
8585
break;
8686
}
8787

src/usr/isteps/tod/TodSvc.C

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2012,2021 */
8+
/* Contributors Listed Below - COPYRIGHT 2012,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -587,7 +587,7 @@ errlHndl_t TodSvc::isMPIPL( bool& o_mpIPL )
587587
TOD_IS_MPIPL,
588588
TOD_TOP_LEVEL_TARGET_NOT_FOUND);
589589

590-
TOD_ERR_ASSERT("Error getting top level target");
590+
TOD_ERR_ASSERT(false, "Error getting top level target");
591591
break;
592592
}
593593
if(true == l_pTopLevelTarget->getAttr<TARGETING::ATTR_IS_MPIPL_HB>())

src/usr/isteps/tod/TodSvcUtil.C

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2012,2020 */
8+
/* Contributors Listed Below - COPYRIGHT 2012,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -283,7 +283,7 @@ char const * topologyTypeToString ( const p10_tod_setup_tod_sel i_topologyType )
283283
case TOD_SECONDARY:
284284
return "Secondary Topology";
285285
default:
286-
TOD_ERR_ASSERT("Unknown Topology Type");
286+
TOD_ERR_ASSERT(false, "Unknown Topology Type");
287287
return "";
288288
}
289289
}

src/usr/isteps/tod/TodUtils.C

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2016,2020 */
8+
/* Contributors Listed Below - COPYRIGHT 2016,2022 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -134,7 +134,7 @@ errlHndl_t getMaxConfigParams(
134134
// Assert on failure getting system target
135135
if(nullptr == l_pTopLevel)
136136
{
137-
TOD_ERR_ASSERT("NULL top level target found");
137+
TOD_ERR_ASSERT(false, "NULL top level target found");
138138
break;
139139

140140
}

src/usr/pnor/pnoraltsync.C

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ using PnorDD = PnorHiomapDD;
5656
#include "pnor_pldmdd.H"
5757
using PnorDD = PnorPldmDD;
5858
#else
59-
#error "No PNOR DD configured"
59+
static_assert(0,"No PNOR DD configured");
6060
#endif
6161

6262
extern trace_desc_t* g_trac_pnor;

src/usr/pnor/pnorvalid.C

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ using PnorDD = PnorHiomapDD;
5757
#include "pnor_pldmdd.H"
5858
using PnorDD = PnorPldmDD;
5959
#else
60-
#error "No PNOR DD configured"
60+
static_assert(0,"No PNOR DD configured");
6161
#endif
6262

6363
// Used for creating an Invalid TOC ("PNOR")

src/usr/vpd/vpd.C

+1-1
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ errlHndl_t ensureEepromCacheIsInSync(TARGETING::Target * i_target,
808808
{
809809
//Set the targets as changed since the p/n's don't match
810810
HWAS::markTargetChanged(i_target);
811-
)
811+
}
812812
#else
813813
//No need to mark target changed here, it will be handled by eecache code
814814
#endif

0 commit comments

Comments
 (0)