mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-16 14:28:56 +00:00
HV: fix expression is not boolean
MISRA-C standard requires the type of result of expression in if/while pattern shall be boolean. Tracked-On: #861 Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
This commit is contained in:
@@ -20,14 +20,13 @@ int32_t parse_hv_cmdline(void)
|
||||
struct multiboot_info *mbi = NULL;
|
||||
|
||||
if (boot_regs[0] != MULTIBOOT_INFO_MAGIC) {
|
||||
ASSERT(0, "no multiboot info found");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mbi = (struct multiboot_info *)(hpa2hva((uint64_t)boot_regs[1]));
|
||||
dev_dbg(ACRN_DBG_PARSE, "Multiboot detected, flag=0x%x", mbi->mi_flags);
|
||||
|
||||
if (!(mbi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE)) {
|
||||
if ((mbi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) == 0U) {
|
||||
dev_dbg(ACRN_DBG_PARSE, "no hv cmdline!");
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -40,7 +39,7 @@ int32_t parse_hv_cmdline(void)
|
||||
start++;
|
||||
|
||||
end = start + 1;
|
||||
while (*end != ' ' && *end)
|
||||
while ((*end != ' ') && ((*end) != '\0'))
|
||||
end++;
|
||||
|
||||
if (!handle_dbg_cmd(start, end - start)) {
|
||||
@@ -48,7 +47,7 @@ int32_t parse_hv_cmdline(void)
|
||||
}
|
||||
start = end + 1;
|
||||
|
||||
} while (*end && *start);
|
||||
} while (((*end) != '\0') && ((*start) != '\0'));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user