From d3ef8ae5cb08e3c5577c43bfa2ba4ce9b9b0b4cd Mon Sep 17 00:00:00 2001 From: "huihuang.shi" Date: Thu, 24 May 2018 10:15:17 +0800 Subject: [PATCH] fix "warning ISO C forbids omitting the middle term of a?:expression" According to the C99 manual 6.5.15 syntax conditional-expression logical-OR-expression logical-OR-expression ? expression :conditional-expression above bnf rules requires expression not be none Signed-off-by: huihuang.shi --- hypervisor/arch/x86/guest/ucode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hypervisor/arch/x86/guest/ucode.c b/hypervisor/arch/x86/guest/ucode.c index 65ef5d013..b2cbc471d 100644 --- a/hypervisor/arch/x86/guest/ucode.c +++ b/hypervisor/arch/x86/guest/ucode.c @@ -50,7 +50,8 @@ uint64_t get_microcode_version(void) * According to SDM vol 3 Table 9-7. If data_size field of uCode * header is zero, the ucode length is 2000 */ -#define GET_DATA_SIZE(hdptr) ((hdptr)->data_size ? : 2000) +#define GET_DATA_SIZE(hdptr) ((hdptr)->data_size ?\ + ((hdptr)->data_size) : 2000) void acrn_update_ucode(struct vcpu *vcpu, uint64_t v) { uint64_t hva, gpa, gva;