diff options
author | Yanan Wang <wangyanan55@huawei.com> | 2021-06-10 16:54:18 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-06-10 07:46:10 -0400 |
commit | 95bf69b400f41fbba7a2dc49b0152dd7bdc9a508 (patch) | |
tree | 3f9a10c4f225384f9c6e1b1aa7b965728cb5fa89 /arch/x86 | |
parent | 218bf772bddd221489c38dde6ef8e917131161f6 (diff) |
KVM: selftests: Fix compiling errors when initializing the static structure
Errors like below were produced from test_util.c when compiling the KVM
selftests on my local platform.
lib/test_util.c: In function 'vm_mem_backing_src_alias':
lib/test_util.c:177:12: error: initializer element is not constant
.flag = anon_flags,
^~~~~~~~~~
lib/test_util.c:177:12: note: (near initialization for 'aliases[0].flag')
The reason is that we are using non-const expressions to initialize the
static structure, which will probably trigger a compiling error/warning
on stricter GCC versions. Fix it by converting the two const variables
"anon_flags" and "anon_huge_flags" into more stable macros.
Fixes: b3784bc28ccc0 ("KVM: selftests: refactor vm_mem_backing_src_type flags")
Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
Message-Id: <20210610085418.35544-1-wangyanan55@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
0 files changed, 0 insertions, 0 deletions