Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kvm/vfio: Constify struct kvm_device_ops

'struct kvm_device_ops' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.

On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
2605 169 16 2790 ae6 virt/kvm/vfio.o

After:
=====
text data bss dec hex filename
2685 89 16 2790 ae6 virt/kvm/vfio.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/e7361a1bb7defbb0f7056b884e83f8d75ac9fe21.1727517084.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Christophe JAILLET and committed by
Alex Williamson
bbee049d 81983758

+1 -1
+1 -1
virt/kvm/vfio.c
··· 353 353 354 354 static int kvm_vfio_create(struct kvm_device *dev, u32 type); 355 355 356 - static struct kvm_device_ops kvm_vfio_ops = { 356 + static const struct kvm_device_ops kvm_vfio_ops = { 357 357 .name = "kvm-vfio", 358 358 .create = kvm_vfio_create, 359 359 .release = kvm_vfio_release,