Skip to contentSkip to conversation

KVM: vfio: Constify static kvm_device_ops

PATCH New Rikard Falkeborn 1 participant 1 message Jan 24, 2022 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: vfio: Constify static kvm_device_ops

kvm_vfio_ops is never modified, so make it const to allow the compiler to put it in read-only memory.

---
 virt/kvm/vfio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
virt/kvm/vfio.c +1 -1
index 8fcbc50221c2..0b305f13489e 100644
@@ -384,7 +384,7 @@ static void kvm_vfio_destroy(struct kvm_device *dev)
 
 static int kvm_vfio_create(struct kvm_device *dev, u32 type);
 
-static struct kvm_device_ops kvm_vfio_ops = {
+static const struct kvm_device_ops kvm_vfio_ops = {
 	.name = "kvm-vfio",
 	.create = kvm_vfio_create,
 	.destroy = kvm_vfio_destroy,
Signature · 1 line
2.34.1