mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 06:51:49 +00:00
hv: debug: fix "Procedure has more than one exit point"
IEC 61508,ISO 26262 standards highly recommend single-exit rule. Reduce the count of the "return entries". Fix the violations which is comply with the cases list below: 1.Function has 2 return entries. 2.The first return entry is used to return the error code of checking variable whether is valid. Fix the violations in "if else" format. Tracked-On: #861 Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
414860fb89
commit
fe3de67906
@ -170,12 +170,7 @@ static void profiling_disable_pmu(void)
|
|||||||
dev_dbg(ACRN_DBG_PROFILING, "%s: entering cpu%d",
|
dev_dbg(ACRN_DBG_PROFILING, "%s: entering cpu%d",
|
||||||
__func__, get_cpu_id());
|
__func__, get_cpu_id());
|
||||||
|
|
||||||
if (ss == NULL) {
|
if (ss != NULL) {
|
||||||
dev_dbg(ACRN_ERR_PROFILING, "%s: exiting cpu%d",
|
|
||||||
__func__, get_cpu_id());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ss->vmexit_msr_cnt == 1) {
|
if (ss->vmexit_msr_cnt == 1) {
|
||||||
/* Set the VM Exit MSR Load in VMCS */
|
/* Set the VM Exit MSR Load in VMCS */
|
||||||
exec_vmwrite(VMX_EXIT_MSR_LOAD_COUNT, 0x0U);
|
exec_vmwrite(VMX_EXIT_MSR_LOAD_COUNT, 0x0U);
|
||||||
@ -207,11 +202,14 @@ static void profiling_disable_pmu(void)
|
|||||||
lvt_perf_ctr |= LVT_PERFCTR_BIT_MASK;
|
lvt_perf_ctr |= LVT_PERFCTR_BIT_MASK;
|
||||||
msr_write(MSR_IA32_EXT_APIC_LVT_PMI, lvt_perf_ctr);
|
msr_write(MSR_IA32_EXT_APIC_LVT_PMI, lvt_perf_ctr);
|
||||||
|
|
||||||
|
|
||||||
ss->pmu_state = PMU_SETUP;
|
ss->pmu_state = PMU_SETUP;
|
||||||
|
|
||||||
dev_dbg(ACRN_DBG_PROFILING, "%s: exiting cpu%d",
|
dev_dbg(ACRN_DBG_PROFILING, "%s: exiting cpu%d",
|
||||||
__func__, get_cpu_id());
|
__func__, get_cpu_id());
|
||||||
|
} else {
|
||||||
|
dev_dbg(ACRN_ERR_PROFILING, "%s: exiting cpu%d",
|
||||||
|
__func__, get_cpu_id());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -759,10 +757,7 @@ void profiling_stop_pmu(void)
|
|||||||
|
|
||||||
dev_dbg(ACRN_DBG_PROFILING, "%s: entering", __func__);
|
dev_dbg(ACRN_DBG_PROFILING, "%s: entering", __func__);
|
||||||
|
|
||||||
if (!in_pmu_profiling) {
|
if (in_pmu_profiling) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0U; i < phys_cpu_num; i++) {
|
for (i = 0U; i < phys_cpu_num; i++) {
|
||||||
per_cpu(profiling_info.ipi_cmd, i) = IPI_PMU_STOP;
|
per_cpu(profiling_info.ipi_cmd, i) = IPI_PMU_STOP;
|
||||||
if (per_cpu(profiling_info.sep_state, i).pmu_state == PMU_RUNNING) {
|
if (per_cpu(profiling_info.sep_state, i).pmu_state == PMU_RUNNING) {
|
||||||
@ -801,6 +796,8 @@ void profiling_stop_pmu(void)
|
|||||||
in_pmu_profiling = false;
|
in_pmu_profiling = false;
|
||||||
|
|
||||||
dev_dbg(ACRN_DBG_PROFILING, "%s: done.", __func__);
|
dev_dbg(ACRN_DBG_PROFILING, "%s: done.", __func__);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user