Skip to content

Commit 2b666ee

Browse files
rbmarlieremstsirkin
authored andcommitted
virtio: make virtio_bus const
Now that the driver core can properly handle constant struct bus_type, move the virtio_bus variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Message-Id: <20240204-bus_cleanup-virtio-v1-1-3bcb2212aaa0@marliere.net> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Jason Wang <jasowang@redhat.com>
1 parent 8169ed6 commit 2b666ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/virtio/virtio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static void virtio_dev_remove(struct device *_d)
353353
of_node_put(dev->dev.of_node);
354354
}
355355

356-
static struct bus_type virtio_bus = {
356+
static const struct bus_type virtio_bus = {
357357
.name = "virtio",
358358
.match = virtio_dev_match,
359359
.dev_groups = virtio_dev_groups,

0 commit comments

Comments
 (0)