diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2013-02-10 00:27:38 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-02-11 00:02:17 -0500 |
commit | 9350393239153c4a98cbed4d69b9ed81e37d5e74 (patch) | |
tree | 180ddb2f2968721c52ed9b5917378aff00c7b7f6 | |
parent | 0d34cc2d6d904e2d0160e42734bccc1cb391cec0 (diff) |
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 <stephen@networkplumber.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | drivers/lguest/lguest_device.c | 2 | ||||
-rw-r--r-- | drivers/remoteproc/remoteproc_virtio.c | 2 | ||||
-rw-r--r-- | drivers/s390/kvm/kvm_virtio.c | 2 | ||||
-rw-r--r-- | drivers/virtio/virtio_mmio.c | 2 | ||||
-rw-r--r-- | drivers/virtio/virtio_pci.c | 2 | ||||
-rw-r--r-- | include/linux/virtio.h | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c index fc92ccbd71dc..b3256ff0d426 100644 --- a/drivers/lguest/lguest_device.c +++ b/drivers/lguest/lguest_device.c | |||
@@ -396,7 +396,7 @@ static const char *lg_bus_name(struct virtio_device *vdev) | |||
396 | } | 396 | } |
397 | 397 | ||
398 | /* The ops structure which hooks everything together. */ | 398 | /* The ops structure which hooks everything together. */ |
399 | static struct virtio_config_ops lguest_config_ops = { | 399 | static const struct virtio_config_ops lguest_config_ops = { |
400 | .get_features = lg_get_features, | 400 | .get_features = lg_get_features, |
401 | .finalize_features = lg_finalize_features, | 401 | .finalize_features = lg_finalize_features, |
402 | .get = lg_get, | 402 | .get = lg_get, |
diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index 9e198e590675..afed9b7731c4 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c | |||
@@ -222,7 +222,7 @@ static void rproc_virtio_finalize_features(struct virtio_device *vdev) | |||
222 | rvdev->gfeatures = vdev->features[0]; | 222 | rvdev->gfeatures = vdev->features[0]; |
223 | } | 223 | } |
224 | 224 | ||
225 | static struct virtio_config_ops rproc_virtio_config_ops = { | 225 | static const struct virtio_config_ops rproc_virtio_config_ops = { |
226 | .get_features = rproc_virtio_get_features, | 226 | .get_features = rproc_virtio_get_features, |
227 | .finalize_features = rproc_virtio_finalize_features, | 227 | .finalize_features = rproc_virtio_finalize_features, |
228 | .find_vqs = rproc_virtio_find_vqs, | 228 | .find_vqs = rproc_virtio_find_vqs, |
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c index 8491111aec12..7d08fba7542d 100644 --- a/drivers/s390/kvm/kvm_virtio.c +++ b/drivers/s390/kvm/kvm_virtio.c | |||
@@ -275,7 +275,7 @@ static const char *kvm_bus_name(struct virtio_device *vdev) | |||
275 | /* | 275 | /* |
276 | * The config ops structure as defined by virtio config | 276 | * The config ops structure as defined by virtio config |
277 | */ | 277 | */ |
278 | static struct virtio_config_ops kvm_vq_configspace_ops = { | 278 | static const struct virtio_config_ops kvm_vq_configspace_ops = { |
279 | .get_features = kvm_get_features, | 279 | .get_features = kvm_get_features, |
280 | .finalize_features = kvm_finalize_features, | 280 | .finalize_features = kvm_finalize_features, |
281 | .get = kvm_get, | 281 | .get = kvm_get, |
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 833e6dbf38db..1ba0d6831015 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c | |||
@@ -423,7 +423,7 @@ static const char *vm_bus_name(struct virtio_device *vdev) | |||
423 | return vm_dev->pdev->name; | 423 | return vm_dev->pdev->name; |
424 | } | 424 | } |
425 | 425 | ||
426 | static struct virtio_config_ops virtio_mmio_config_ops = { | 426 | static const struct virtio_config_ops virtio_mmio_config_ops = { |
427 | .get = vm_get, | 427 | .get = vm_get, |
428 | .set = vm_set, | 428 | .set = vm_set, |
429 | .get_status = vm_get_status, | 429 | .get_status = vm_get_status, |
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 0c142892c105..52c5ce6aec8d 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c | |||
@@ -652,7 +652,7 @@ static int vp_set_vq_affinity(struct virtqueue *vq, int cpu) | |||
652 | return 0; | 652 | return 0; |
653 | } | 653 | } |
654 | 654 | ||
655 | static struct virtio_config_ops virtio_pci_config_ops = { | 655 | static const struct virtio_config_ops virtio_pci_config_ops = { |
656 | .get = vp_get, | 656 | .get = vp_get, |
657 | .set = vp_set, | 657 | .set = vp_set, |
658 | .get_status = vp_get_status, | 658 | .get_status = vp_get_status, |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index cf8adb1f5b2c..eb34cf774473 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -78,7 +78,7 @@ struct virtio_device { | |||
78 | int index; | 78 | int index; |
79 | struct device dev; | 79 | struct device dev; |
80 | struct virtio_device_id id; | 80 | struct virtio_device_id id; |
81 | struct virtio_config_ops *config; | 81 | const struct virtio_config_ops *config; |
82 | struct list_head vqs; | 82 | struct list_head vqs; |
83 | /* Note that this is a Linux set_bit-style bitmap. */ | 83 | /* Note that this is a Linux set_bit-style bitmap. */ |
84 | unsigned long features[1]; | 84 | unsigned long features[1]; |