• Arnd Bergmann's avatar
    kvm: avoid uninitialized-variable warnings · 076b925d
    Arnd Bergmann authored
    When PAGE_OFFSET is not a compile-time constant, we run into
    warnings from the use of kvm_is_error_hva() that the compiler
    cannot optimize out:
    
    arch/arm/kvm/../../../virt/kvm/kvm_main.c: In function '__kvm_gfn_to_hva_cache_init':
    arch/arm/kvm/../../../virt/kvm/kvm_main.c:1978:14: error: 'nr_pages_avail' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    arch/arm/kvm/../../../virt/kvm/kvm_main.c: In function 'gfn_to_page_many_atomic':
    arch/arm/kvm/../../../virt/kvm/kvm_main.c:1660:5: error: 'entry' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    
    This adds fake initializations to the two instances I ran into.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
    076b925d
kvm_main.c 96.3 KB