From: Stephen Hemminger Date: Sun, 10 Feb 2013 05:27:38 +0000 (+1030) Subject: virtio: make config_ops const X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9350393239153c4a98cbed4d69b9ed81e37d5e74;p=linux-beck.git 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 Signed-off-by: Rusty Russell --- 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) } /* The ops structure which hooks everything together. */ -static struct virtio_config_ops lguest_config_ops = { +static const struct virtio_config_ops lguest_config_ops = { .get_features = lg_get_features, .finalize_features = lg_finalize_features, .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) rvdev->gfeatures = vdev->features[0]; } -static struct virtio_config_ops rproc_virtio_config_ops = { +static const struct virtio_config_ops rproc_virtio_config_ops = { .get_features = rproc_virtio_get_features, .finalize_features = rproc_virtio_finalize_features, .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) /* * The config ops structure as defined by virtio config */ -static struct virtio_config_ops kvm_vq_configspace_ops = { +static const struct virtio_config_ops kvm_vq_configspace_ops = { .get_features = kvm_get_features, .finalize_features = kvm_finalize_features, .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) 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, 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) 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, 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 { int index; struct device dev; struct virtio_device_id id; - struct virtio_config_ops *config; + const struct virtio_config_ops *config; struct list_head vqs; /* Note that this is a Linux set_bit-style bitmap. */ unsigned long features[1];