ARM: KVM: fix warning in mmu.c
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 30 Jan 2014 17:38:33 +0000 (17:38 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:18:37 +0000 (17:18 +0200)
commit0ddf276ba9c11c5bd993c7c87226dde6fc5ffa51
tree942c14862cacc19e14915ad0311044b2392b14b9
parent11178dce0398cd8419c639c8ab81357cb4f2bbf0
ARM: KVM: fix warning in mmu.c

Compiling with THP enabled leads to the following warning:

arch/arm/kvm/mmu.c: In function ‘unmap_range’:
arch/arm/kvm/mmu.c:177:39: warning: ‘pte’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (kvm_pmd_huge(*pmd) || page_empty(pte)) {
                                        ^
Code inspection reveals that these two cases are mutually exclusive,
so GCC is a bit overzealous here. Silence it anyway by initializing
pte to NULL and testing it later on.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
(cherry picked from commit 56041bf920d2937b7cadcb30cb206f0372eee814)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/kvm/mmu.c