HV:common: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-19 14:25:22 +08:00
committed by lijinxia
parent 23921384d0
commit f92931c879
8 changed files with 61 additions and 61 deletions

View File

@@ -43,7 +43,7 @@ static uint64_t create_zero_page(struct vm *vm)
&(hva->hdr), sizeof(hva->hdr));
/* See if kernel has a RAM disk */
if (sw_linux->ramdisk_src_addr) {
if (sw_linux->ramdisk_src_addr != NULL) {
/* Copy ramdisk load_addr and size in zeropage header structure
*/
zeropage->hdr.ramdisk_addr =
@@ -197,7 +197,7 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
#endif
/* Check if a RAM disk is present with Linux guest */
if (vm->sw.linux_info.ramdisk_src_addr) {
if (vm->sw.linux_info.ramdisk_src_addr != NULL) {
/* Get host-physical address for guest RAM disk */
hva = GPA2HVA(vm,
(uint64_t)vm->sw.linux_info.ramdisk_load_addr);