diff --git a/hypervisor/boot/guest/bzimage_loader.c b/hypervisor/boot/guest/bzimage_loader.c index d6c8ebd12..55bd6337e 100644 --- a/hypervisor/boot/guest/bzimage_loader.c +++ b/hypervisor/boot/guest/bzimage_loader.c @@ -31,10 +31,10 @@ * should be able to accommodate it and so that avoid the trampoline corruption. */ #define BZIMG_LOAD_PARAMS_SIZE (MEM_4K * 8) -#define BZIMG_INITGDT_GPA(load_params_gpa) (load_params_gpa + 0UL) -#define BZIMG_ZEROPAGE_GPA(load_params_gpa) (load_params_gpa + MEM_1K) -#define BZIMG_CMDLINE_GPA(load_params_gpa) (load_params_gpa + MEM_1K + MEM_4K) -#define BZIMG_EFIMMAP_GPA(load_params_gpa) (load_params_gpa + MEM_1K + MEM_4K + MEM_2K) +#define BZIMG_INITGDT_GPA(load_params_gpa) ((load_params_gpa) + 0UL) +#define BZIMG_ZEROPAGE_GPA(load_params_gpa) ((load_params_gpa) + MEM_1K) +#define BZIMG_CMDLINE_GPA(load_params_gpa) ((load_params_gpa) + MEM_1K + MEM_4K) +#define BZIMG_EFIMMAP_GPA(load_params_gpa) ((load_params_gpa) + MEM_1K + MEM_4K + MEM_2K) /* TODO: * The value is referenced from Linux boot protocal for old kernels, diff --git a/hypervisor/include/arch/x86/asm/guest/vcpu.h b/hypervisor/include/arch/x86/asm/guest/vcpu.h index 6014b5497..ea34183df 100644 --- a/hypervisor/include/arch/x86/asm/guest/vcpu.h +++ b/hypervisor/include/arch/x86/asm/guest/vcpu.h @@ -142,7 +142,7 @@ for ((idx) = 0U, (vcpu) = &((vm)->hw.vcpu_array[(idx)]); \ (idx) < (vm)->hw.created_vcpus; \ (idx)++, (vcpu) = &((vm)->hw.vcpu_array[(idx)])) \ - if (vcpu->state != VCPU_OFFLINE) + if ((vcpu)->state != VCPU_OFFLINE) enum vcpu_state { VCPU_OFFLINE = 0U, diff --git a/hypervisor/include/arch/x86/asm/guest/vmcs.h b/hypervisor/include/arch/x86/asm/guest/vmcs.h index d1738b045..def48f2d5 100644 --- a/hypervisor/include/arch/x86/asm/guest/vmcs.h +++ b/hypervisor/include/arch/x86/asm/guest/vmcs.h @@ -8,7 +8,7 @@ #define VMCS_H_ #define VM_SUCCESS 0 -#define VM_FAIL -1 +#define VM_FAIL (-1) #ifndef ASSEMBLER #include diff --git a/hypervisor/include/arch/x86/asm/vtd.h b/hypervisor/include/arch/x86/asm/vtd.h index 90f103393..7e1257d0a 100644 --- a/hypervisor/include/arch/x86/asm/vtd.h +++ b/hypervisor/include/arch/x86/asm/vtd.h @@ -481,7 +481,7 @@ static inline uint16_t dma_frcd_up_sid(uint64_t up_sid) #define DRHD_FLAG_INCLUDE_PCI_ALL_MASK (1U) -#define DEVFUN(dev, fun) (((dev & 0x1FU) << 3U) | ((fun & 0x7U))) +#define DEVFUN(dev, fun) ((((dev) & 0x1FU) << 3U) | (((fun) & 0x7U))) struct dmar_dev_scope { enum acpi_dmar_scope_type type; diff --git a/hypervisor/include/lib/list.h b/hypervisor/include/lib/list.h index 38103006b..4084fe958 100644 --- a/hypervisor/include/lib/list.h +++ b/hypervisor/include/lib/list.h @@ -156,6 +156,6 @@ hlist_add_head(struct hlist_node *n, struct hlist_head *h) #define hlist_entry(ptr, type, member) container_of(ptr,type,member) #define hlist_for_each(pos, head) \ - for (pos = (head)->first; (pos) != NULL; pos = (pos)->next) + for ((pos) = (head)->first; (pos) != NULL; (pos) = (pos)->next) #endif /* LIST_H_ */