]> git.baikalelectronics.ru Git - kernel.git/commit
kvm/emulate: fix a -Werror=cast-function-type
authorQian Cai <cai@lca.pw>
Mon, 17 Feb 2020 16:48:26 +0000 (11:48 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 20 Feb 2020 17:13:45 +0000 (18:13 +0100)
commita264ba1108e69573378200157e7aa85bf525e22c
tree5bf5aad251b9b2b4b9b4e964cb9d05a465165d51
parentd6bda059e32e3195fbeeeb815b9e6f4cfd102e4b
kvm/emulate: fix a -Werror=cast-function-type

arch/x86/kvm/emulate.c: In function 'x86_emulate_insn':
arch/x86/kvm/emulate.c:5686:22: error: cast between incompatible
function types from 'int (*)(struct x86_emulate_ctxt *)' to 'void
(*)(struct fastop *)' [-Werror=cast-function-type]
    rc = fastop(ctxt, (fastop_t)ctxt->execute);

Fix it by using an unnamed union of a (*execute) function pointer and a
(*fastop) function pointer.

Fixes: e61bb41949fb ("KVM: x86: Use a typedef for fastop functions")
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Qian Cai <cai@lca.pw>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/emulate.c