Skip to content

Commit

Permalink
virtio: make virtio_bus const
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rbmarliere authored and mstsirkin committed Mar 19, 2024
1 parent 8169ed6 commit 2b666ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/virtio/virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static void virtio_dev_remove(struct device *_d)
of_node_put(dev->dev.of_node);
}

static struct bus_type virtio_bus = {
static const struct bus_type virtio_bus = {
.name = "virtio",
.match = virtio_dev_match,
.dev_groups = virtio_dev_groups,
Expand Down

0 comments on commit 2b666ee

Please sign in to comment.