Commit 0db1dba5 authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Michael S. Tsirkin

virtio/s390: virtio: constify virtio_config_ops structures

Declare virtio_config_ops structure as const as it is only stored in the
config field of a virtio_device structure. This field is of type const, so
virtio_config_ops structures having this property can be declared const.
Done using Coccinelle:

@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct virtio_config_ops i@p={...};

@ok1@
identifier r1.i;
position p;
struct virtio_ccw_device x;
@@
x.vdev.config=&i@p

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct virtio_config_ops i;

File size before and after applying the patch remains the same.
text	data	bss	dec	hex   filename
9235	296	32928	42459	a5db  drivers/s390/virtio/virtio_ccw.o
Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
Message-Id: <1484333336-13443-1-git-send-email-bhumirks@gmail.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
parent 99240622
...@@ -944,7 +944,7 @@ static void virtio_ccw_set_status(struct virtio_device *vdev, u8 status) ...@@ -944,7 +944,7 @@ static void virtio_ccw_set_status(struct virtio_device *vdev, u8 status)
kfree(ccw); kfree(ccw);
} }
static struct virtio_config_ops virtio_ccw_config_ops = { static const struct virtio_config_ops virtio_ccw_config_ops = {
.get_features = virtio_ccw_get_features, .get_features = virtio_ccw_get_features,
.finalize_features = virtio_ccw_finalize_features, .finalize_features = virtio_ccw_finalize_features,
.get = virtio_ccw_get_config, .get = virtio_ccw_get_config,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment