]> git.baikalelectronics.ru Git - kernel.git/commit
Silence compiler warning in arch/x86/kvm/emulate.c
authorValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Sat, 29 Aug 2015 21:49:16 +0000 (17:49 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 6 Sep 2015 14:26:23 +0000 (16:26 +0200)
commit077ac7414ff335e0a1310acf891567cb46a14034
tree188e752a2fa07e32f25bc41e77b272caeaec08fd
parent462dceb5e5f0b30eb4c5e12604ee40f912dca1a0
Silence compiler warning in arch/x86/kvm/emulate.c

Compiler warning:

 CC [M]  arch/x86/kvm/emulate.o
arch/x86/kvm/emulate.c: In function "__do_insn_fetch_bytes":
arch/x86/kvm/emulate.c:814:9: warning: "linear" may be used uninitialized in this function [-Wmaybe-uninitialized]

GCC is smart enough to realize that the inlined __linearize may return before
setting the value of linear, but not smart enough to realize the same
X86EMU_CONTINUE blocks actual use of the value.  However, the value of
'linear' can only be set to one value, so hoisting the one line of code
upwards makes GCC happy with the code.

Reported-by: Aruna Hewapathirane <aruna.hewapathirane@gmail.com>
Tested-by: Aruna Hewapathirane <aruna.hewapathirane@gmail.com>
Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c