[PATCH v4 6/6] KVM: Remove unused file_is_kvm

From: Steffen Eiden

Date: Mon Sep 28 2026 - 09:28:39 EST


Remove the now unused file_is_kvm function.

Signed-off-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>
---
include/linux/kvm_host.h | 1 -
virt/kvm/kvm_main.c | 6 ------
2 files changed, 7 deletions(-)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 3c5a389361c6..586f6e8bb81b 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1087,7 +1087,6 @@ void kvm_exit(void);
void kvm_get_kvm(struct kvm *kvm);
bool kvm_get_kvm_safe(struct kvm *kvm);
void kvm_put_kvm(struct kvm *kvm);
-bool file_is_kvm(struct file *file);

/*
* Architectures define kvm_file_to_kvm_arch to <arch>
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index ff4fab9753ca..60e614795a36 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -5515,12 +5515,6 @@ static struct file_operations kvm_vm_fops = {
KVM_COMPAT(kvm_vm_compat_ioctl),
};

-bool file_is_kvm(struct file *file)
-{
- return file && file->f_op == &kvm_vm_fops;
-}
-EXPORT_SYMBOL_FOR_KVM_INTERNAL(file_is_kvm);
-
#ifdef kvm_file_to_kvm_arch
struct kvm *kvm_file_to_kvm_fn(struct file *file)
{

--
2.53.0