diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2013-04-26 13:23:30 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-05-01 14:03:50 -0500 |
commit | c9be87b42af523b35b1bcb727527341ecd9a5fd4 (patch) | |
tree | f72d32196b3fbbca0b994bfc61a4bdecc4eb6d5c /src | |
parent | 02cf3abca60d9f7e2b218e1a445c3c80230a3ceb (diff) | |
download | talos-hostboot-c9be87b42af523b35b1bcb727527341ecd9a5fd4.tar.gz talos-hostboot-c9be87b42af523b35b1bcb727527341ecd9a5fd4.zip |
Clean up potential uninitialized object instances.
Change-Id: I859f94234d5672f55f745dd37b9662c310b694a7
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4236
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/gcov.h | 6 | ||||
-rw-r--r-- | src/kernel/block.C | 2 | ||||
-rw-r--r-- | src/kernel/exception.C | 3 | ||||
-rw-r--r-- | src/kernel/misc.C | 6 | ||||
-rw-r--r-- | src/kernel/msghandler.C | 49 | ||||
-rw-r--r-- | src/kernel/taskmgr.C | 51 | ||||
-rw-r--r-- | src/kernel/timemgr.C | 47 | ||||
-rwxr-xr-x | src/libc++/builtins.C | 4 | ||||
-rw-r--r-- | src/usr/diag/mdia/mdia.C | 2 | ||||
-rwxr-xr-x | src/usr/diag/mdia/mdiamonitor.C | 2 | ||||
-rw-r--r-- | src/usr/diag/mdia/mdiasm.C | 4 | ||||
-rw-r--r-- | src/usr/diag/mdia/test/mdiatestmba.H | 6 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/framework/config/prdfPllDomain.C | 2 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C | 2 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C | 2 |
15 files changed, 91 insertions, 97 deletions
diff --git a/src/include/usr/gcov.h b/src/include/usr/gcov.h index a8e20f4fc..f5e06b844 100644 --- a/src/include/usr/gcov.h +++ b/src/include/usr/gcov.h @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -146,11 +146,11 @@ void __gcov_module_copychain(gcov_info* chain) while(chain != NULL) { // Copy old info. - gcov_info* new_info = new gcov_info; + gcov_info* new_info = new gcov_info(); memcpy(new_info, chain, sizeof(gcov_info)); // Copy old counters. - uint64_t* new_counters = new uint64_t[chain->n_counters]; + uint64_t* new_counters = new uint64_t[chain->n_counters](); memcpy(new_counters, chain->counters, chain->n_counters*sizeof(uint64_t)); new_info->counters = new_counters; diff --git a/src/kernel/block.C b/src/kernel/block.C index c33529963..7cd7e75af 100644 --- a/src/kernel/block.C +++ b/src/kernel/block.C @@ -66,7 +66,7 @@ void Block::init(MessageQueue* i_msgQ, uint64_t *i_spteAddr) if (i_spteAddr == NULL) { // Create a shadow PTE for each page. - iv_ptes = new ShadowPTE[iv_size / PAGESIZE]; + iv_ptes = new ShadowPTE[iv_size / PAGESIZE](); } else // set the page table to reside at the address requested { diff --git a/src/kernel/exception.C b/src/kernel/exception.C index 80e04fc34..c82bfec98 100644 --- a/src/kernel/exception.C +++ b/src/kernel/exception.C @@ -199,8 +199,7 @@ void kernel_execute_fp_unavail() { // Enable FP by creating a FP context. // Context switch code will handle the rest. - t->fp_context = new context_fp_t; - memset(t->fp_context, '\0', sizeof(context_fp_t)); + t->fp_context = new context_fp_t(); } } diff --git a/src/kernel/misc.C b/src/kernel/misc.C index 9fd511c33..e280a1527 100644 --- a/src/kernel/misc.C +++ b/src/kernel/misc.C @@ -179,8 +179,7 @@ namespace KernelMisc CpuManager::deactivateCPU(cpu); // Create kernel save area and store ptr in bottom of kernel stack. - task_t* saveArea = new task_t; - memset(saveArea, '\0', sizeof(task_t)); + task_t* saveArea = new task_t(); saveArea->context.msr_mask = 0xD030; // EE, ME, PR, IR, DR. *(reinterpret_cast<task_t**>(cpu->kernel_stack_bottom)) = saveArea; @@ -251,8 +250,7 @@ namespace KernelMisc CpuManager::deactivateCPU(cpu); // Create kernel save area and store ptr in bottom of kernel stack. - task_t* saveArea = new task_t; - memset(saveArea, '\0', sizeof(task_t)); + task_t* saveArea = new task_t(); saveArea->context.msr_mask = 0xD030; // EE, ME, PR, IR, DR. *(reinterpret_cast<task_t**>(cpu->kernel_stack_bottom)) = saveArea; diff --git a/src/kernel/msghandler.C b/src/kernel/msghandler.C index 7761d36ae..4530ed6b6 100644 --- a/src/kernel/msghandler.C +++ b/src/kernel/msghandler.C @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/kernel/msghandler.C $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2011-2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/kernel/msghandler.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #include <assert.h> #include <errno.h> #include <util/locked/queue.H> @@ -38,7 +37,7 @@ void MessageHandler::sendMessage(msg_sys_types_t i_type, void* i_key, task_t* ready_task = NULL; // Save pending info for when we get the response. - MessageHandler_Pending* mhp = new MessageHandler_Pending; + MessageHandler_Pending* mhp = new MessageHandler_Pending(); mhp->key = i_key; mhp->task = i_task; @@ -53,7 +52,7 @@ void MessageHandler::sendMessage(msg_sys_types_t i_type, void* i_key, if (!iv_pending.find(i_key)) { // Create message. - msg_t* m = new msg_t; + msg_t* m = new msg_t(); m->type = i_type; m->data[0] = reinterpret_cast<uint64_t>(i_key); m->data[1] = reinterpret_cast<uint64_t>(i_data); diff --git a/src/kernel/taskmgr.C b/src/kernel/taskmgr.C index 2ff6ce4ad..6a4850fec 100644 --- a/src/kernel/taskmgr.C +++ b/src/kernel/taskmgr.C @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/kernel/taskmgr.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2010 - 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/kernel/taskmgr.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2010,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #include <util/singleton.H> #include <kernel/taskmgr.H> #include <kernel/task.H> @@ -86,8 +86,7 @@ task_t* TaskManager::_createIdleTask() task_t* TaskManager::_createTask(TaskManager::task_fn_t t, void* p, bool withStack, bool kernelParent) { - task_t* task = new task_t; - memset(task, '\0', sizeof(task_t)); + task_t* task = new task_t(); task->tid = this->getNextTid(); @@ -127,7 +126,7 @@ task_t* TaskManager::_createTask(TaskManager::task_fn_t t, task->state_info = NULL; // Create tracker instance for this task. - task_tracking_t* tracker = new task_tracking_t; + task_tracking_t* tracker = new task_tracking_t(); tracker->key = task->tid; tracker->task = task; tracker->status = -1; @@ -293,7 +292,7 @@ void TaskManager::_waitTask(task_t* t, int64_t tid, int* status, void** retval) } else // Otherwise, create wait-info to defer task. { - task_wait_t* tj = t->tracker->wait_info = new task_wait_t; + task_wait_t* tj = t->tracker->wait_info = new task_wait_t(); tj->tid = tid; tj->status = status; tj->retval = retval; diff --git a/src/kernel/timemgr.C b/src/kernel/timemgr.C index 32ffa4a68..fd4c55853 100644 --- a/src/kernel/timemgr.C +++ b/src/kernel/timemgr.C @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/kernel/timemgr.C $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2010-2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/kernel/timemgr.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2010,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #include <kernel/timemgr.H> #include <kernel/scheduler.H> #include <util/singleton.H> @@ -46,7 +45,7 @@ void TimeManager::init_cpu(cpu_t* cpu) void TimeManager::_init_cpu(cpu_t* cpu) { - cpu->delay_list = new delaylist_t; + cpu->delay_list = new delaylist_t(); } uint64_t TimeManager::convertSecToTicks(uint64_t i_sec, uint64_t i_nsec) diff --git a/src/libc++/builtins.C b/src/libc++/builtins.C index 7cef85485..02953d72d 100755 --- a/src/libc++/builtins.C +++ b/src/libc++/builtins.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2010,2012 */ +/* COPYRIGHT International Business Machines Corp. 2010,2013 */ /* */ /* p1 */ /* */ @@ -149,7 +149,7 @@ extern "C" int __cxa_atexit(void (*i_dtor)(void*), // TODO - Only need dtors for extended image modules if(i_dso_handle != __dso_handle) { - DtorEntry_t * entry = new DtorEntry_t; + DtorEntry_t * entry = new DtorEntry_t(); entry->key = i_dso_handle; entry->dtor = i_dtor; entry->arg = i_arg; diff --git a/src/usr/diag/mdia/mdia.C b/src/usr/diag/mdia/mdia.C index 026cd72cc..c14bec331 100644 --- a/src/usr/diag/mdia/mdia.C +++ b/src/usr/diag/mdia/mdia.C @@ -48,7 +48,7 @@ errlHndl_t runStep(const TargetHandleList & i_targetList) errlHndl_t err = 0; - Globals globals; + Globals globals = {}; TargetHandle_t top = 0; targetService().getTopLevelTarget(top); diff --git a/src/usr/diag/mdia/mdiamonitor.C b/src/usr/diag/mdia/mdiamonitor.C index 6327cd057..925bef218 100755 --- a/src/usr/diag/mdia/mdiamonitor.C +++ b/src/usr/diag/mdia/mdiamonitor.C @@ -180,7 +180,7 @@ void CommandMonitor::start(StateMachine & i_sm) if(!iv_tid) { - ThreadArgs * args = new ThreadArgs; + ThreadArgs * args = new ThreadArgs(); if(NULL != args) { args->obj = this; diff --git a/src/usr/diag/mdia/mdiasm.C b/src/usr/diag/mdia/mdiasm.C index e201d83e3..f46575c8c 100644 --- a/src/usr/diag/mdia/mdiasm.C +++ b/src/usr/diag/mdia/mdiasm.C @@ -215,7 +215,7 @@ void StateMachine::setup(const WorkFlowAssocMap & i_list) // to indicate that no work has been done yet // for the target - p = new WorkFlowProperties; + p = new WorkFlowProperties(); p->assoc = it; p->workItem = getWorkFlow(it).begin(); @@ -352,7 +352,7 @@ bool StateMachine::scheduleWorkItem(WorkFlowProperties & i_wfp) if(!iv_tp) { MDIA_FAST("Starting threadPool..."); - iv_tp = new Util::ThreadPool<WorkItem>; + iv_tp = new Util::ThreadPool<WorkItem>(); iv_tp->start(); } diff --git a/src/usr/diag/mdia/test/mdiatestmba.H b/src/usr/diag/mdia/test/mdiatestmba.H index da7298a34..b855c66a2 100644 --- a/src/usr/diag/mdia/test/mdiatestmba.H +++ b/src/usr/diag/mdia/test/mdiatestmba.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -47,7 +47,7 @@ class MdiaMbaTest : public CxxTest::TestSuite TS_TRACE(ENTER_MRK "testGetMbaDiagnosticMode"); DiagMode mode; - Globals globals; + Globals globals = {}; TargetHandle_t mba = 0; errlHndl_t err = getMbaDiagnosticMode( @@ -73,7 +73,7 @@ class MdiaMbaTest : public CxxTest::TestSuite TS_TRACE(ENTER_MRK "testGetMbaWorkFlow"); - Globals globals; + Globals globals = {}; TargetHandle_t mba = 0; DiagMode mode; diff --git a/src/usr/diag/prdf/common/framework/config/prdfPllDomain.C b/src/usr/diag/prdf/common/framework/config/prdfPllDomain.C index a777d13e9..2eab1698c 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfPllDomain.C +++ b/src/usr/diag/prdf/common/framework/config/prdfPllDomain.C @@ -111,7 +111,7 @@ int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, ATTENTION_TYPE attentionType) { typedef ExtensibleChip * ChipPtr; - CcAutoDeletePointerVector<ChipPtr> chip(new ChipPtr[GetSize()]); + CcAutoDeletePointerVector<ChipPtr> chip(new ChipPtr[GetSize()]()); int count = 0; int32_t rc = SUCCESS; diff --git a/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C b/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C index 1313f9513..654da30ad 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C +++ b/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C @@ -71,7 +71,7 @@ namespace Prdr } else { - (*o_chip) = new Chip; + (*o_chip) = new Chip(); do { diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C b/src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C index 67a7beef7..2bd339535 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C @@ -33,7 +33,7 @@ namespace SystemSpecific { PRDF::Configurator * getConfiguratorPtr() { - return new PRDF::PegasusConfigurator; + return new PRDF::PegasusConfigurator(); } void postAnalysisWorkarounds(STEP_CODE_DATA_STRUCT & i_sdc) |