Skip to content

Commit 80583d0

Browse files
committed
KVM: guest-memfd: fix unused-function warning
With migration disabled, one function becomes unused: 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, | ^~~~~~~~~~~~~~~~~~~~~~ Remove the #ifdef around the reference so that fallback_migrate_folio() is never used. The gmem implementation of the hook is trivial; since the gmem mapping is unmovable, the pages should not be migrated anyway. Fixes: a7800aa ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory") Reported-by: Arnd Bergmann <arnd@arndb.de> Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 849c181 commit 80583d0

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

virt/kvm/guest_memfd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,7 @@ static int kvm_gmem_error_page(struct address_space *mapping, struct page *page)
300300

301301
static const struct address_space_operations kvm_gmem_aops = {
302302
.dirty_folio = noop_dirty_folio,
303-
#ifdef CONFIG_MIGRATION
304303
.migrate_folio = kvm_gmem_migrate_folio,
305-
#endif
306304
.error_remove_page = kvm_gmem_error_page,
307305
};
308306

0 commit comments

Comments
 (0)