lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] KVM: vfio: Constify static kvm_device_ops
Date
kvm_vfio_ops is never modified, so make it const to allow the compiler
to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
virt/kvm/vfio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/vfio.c b/virt/kvm/vfio.c
index 8fcbc50221c2..0b305f13489e 100644
--- a/virt/kvm/vfio.c
+++ b/virt/kvm/vfio.c
@@ -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,
--
2.34.1
\
 
 \ /
  Last update: 2022-01-25 00:11    [W:0.017 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site