virtio: make config_ops const

It is just a table of function pointers, make it const for cleanliness and security
reasons.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
Stephen Hemminger 2013-02-10 15:57:38 +10:30 • committed by Rusty Russell
commit 9350393239
6 changed files with 6 additions and 6 deletions

View file

@ -423,7 +423,7 @@ static const char *vm_bus_name(struct virtio_device *vdev)
return vm_dev->pdev->name;
}
static struct virtio_config_ops virtio_mmio_config_ops = {
static const struct virtio_config_ops virtio_mmio_config_ops = {
.get = vm_get,
.set = vm_set,
.get_status = vm_get_status,

View file

@ -652,7 +652,7 @@ static int vp_set_vq_affinity(struct virtqueue *vq, int cpu)
return 0;
}
static struct virtio_config_ops virtio_pci_config_ops = {
static const struct virtio_config_ops virtio_pci_config_ops = {
.get = vp_get,
.set = vp_set,
.get_status = vp_get_status,