HV:treewide:fix "expression is not Boolean"

MISRA C explicit required expression should be boolean when
in branch statements (if,while...).

Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Huihuang Shi
2018-06-20 13:28:25 +08:00
committed by lijinxia
parent f92931c879
commit be0f5e6c16
17 changed files with 157 additions and 157 deletions

View File

@@ -170,7 +170,7 @@ again:
continue;
}
if (j && mmap[j-1].mm_type == e820_type &&
if ((j != 0) && mmap[j-1].mm_type == e820_type &&
(mmap[j-1].mm_base_addr + mmap[j-1].mm_length)
== d->PhysicalStart) {
mmap[j-1].mm_length += d->NumberOfPages << EFI_PAGE_SHIFT;
@@ -247,7 +247,7 @@ switch_to_guest_mode(EFI_HANDLE image)
config_table++;
}
if (!rsdp) {
if (rsdp == NULL) {
Print(L"unable to find RSDP\n");
goto out;
}

View File

@@ -39,9 +39,9 @@ void efi_spurious_handler(int vector)
return;
vcpu = per_cpu(vcpu, 0);
if (vcpu && vcpu->arch_vcpu.vlapic) {
if ((vcpu != NULL) && vcpu->arch_vcpu.vlapic) {
ret = vlapic_set_intr(vcpu, vector, 0);
if (ret)
if (ret != 0)
pr_err("%s vlapic set intr fail, interrupt lost\n",
__func__);
} else