Re: [PATCH 1/1] KVM: Move kvm_gmem_migrate_folio inside CONFIG_MIGRATION

From: Sean Christopherson
Date: Mon Dec 11 2023 - 10:15:42 EST


On Mon, Dec 11, 2023, 'Guanjun' wrote:
> From: Guanjun <guanjun@xxxxxxxxxxxxxxxxx>
>
> 'kvm_gmem_migrate_folio' is only used when CONFIG_MIGRATION
> is defined, And it will triggers the compiler warning about
> 'kvm_gmem_migrate_folio' defined but not used when CONFIG_MIGRATION
> isn't defined.
>
> The compiler complained like that:
> arch/x86/kvm/../../../virt/kvm/guest_memfd.c:262:12: error: ‘kvm_gmem_migrate_folio’ defined but not used [-Werror=unused-function]
> 262 | static int kvm_gmem_migrate_folio(struct address_space *mapping,
> | ^~~~~~~~~~~~~~~~~~~~~~

Already fixed, commit 80583d0cfd8f ("KVM: guest-memfd: fix unused-function warning")
in kvm/next.

https://lore.kernel.org/all/20231208184908.2298225-1-pbonzini@xxxxxxxxxx