mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-08 04:09:11 +00:00
fix "function return type inconsistent"
MISRA C required function return type should be consistented. Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
committed by
Xie, nanlin
parent
1a607b669d
commit
9600dfa07d
@@ -77,7 +77,7 @@ inline bool cpu_has_cap(uint32_t bit)
|
||||
if (feat_idx >= FEATURE_WORDS)
|
||||
return false;
|
||||
|
||||
return !!(boot_cpu_data.cpuid_leaves[feat_idx] & (1 << feat_bit));
|
||||
return ((boot_cpu_data.cpuid_leaves[feat_idx] & (1 << feat_bit)) != 0U);
|
||||
}
|
||||
|
||||
static inline bool get_monitor_cap(void)
|
||||
@@ -250,7 +250,7 @@ static void alloc_phy_cpu_data(uint16_t pcpu_num)
|
||||
ASSERT(per_cpu_data_base_ptr != NULL, "");
|
||||
}
|
||||
|
||||
int __attribute__((weak)) parse_madt(uint8_t *lapic_id_base)
|
||||
uint16_t __attribute__((weak)) parse_madt(uint8_t *lapic_id_base)
|
||||
{
|
||||
static const uint32_t lapic_id[] = {0, 2, 4, 6};
|
||||
uint32_t i;
|
||||
|
@@ -163,9 +163,9 @@ uint64_t hpa2gpa(struct vm *vm, uint64_t hpa)
|
||||
| (hpa & (entry.page_size - 1)));
|
||||
}
|
||||
|
||||
int is_ept_supported(void)
|
||||
bool is_ept_supported(void)
|
||||
{
|
||||
uint16_t status;
|
||||
bool status;
|
||||
uint64_t tmp64;
|
||||
|
||||
/* Read primary processor based VM control. */
|
||||
@@ -179,14 +179,14 @@ int is_ept_supported(void)
|
||||
/* Check if EPT is supported. */
|
||||
if ((tmp64 & (((uint64_t)VMX_PROCBASED_CTLS2_EPT) << 32)) != 0U) {
|
||||
/* EPT is present. */
|
||||
status = 1;
|
||||
status = true;
|
||||
} else {
|
||||
status = 0;
|
||||
status = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Secondary processor based VM control is not present */
|
||||
status = 0;
|
||||
status = false;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
@@ -109,12 +109,12 @@ static inline void inv_tlb_one_page(void *addr)
|
||||
|
||||
static inline bool cpu_has_vmx_ept_cap(uint32_t bit_mask)
|
||||
{
|
||||
return !!(vmx_caps.ept & bit_mask);
|
||||
return ((vmx_caps.ept & bit_mask) != 0U);
|
||||
}
|
||||
|
||||
static inline bool cpu_has_vmx_vpid_cap(uint32_t bit_mask)
|
||||
{
|
||||
return !!(vmx_caps.vpid & bit_mask);
|
||||
return ((vmx_caps.vpid & bit_mask) != 0U);
|
||||
}
|
||||
|
||||
int check_vmx_mmu_cap(void)
|
||||
|
@@ -1201,7 +1201,7 @@ static void init_exec_ctrl(struct vcpu *vcpu)
|
||||
}
|
||||
|
||||
/* Check for EPT support */
|
||||
if (is_ept_supported() != 0)
|
||||
if (is_ept_supported())
|
||||
pr_dbg("EPT is supported");
|
||||
else
|
||||
pr_err("Error: EPT is not supported");
|
||||
|
Reference in New Issue
Block a user