vdpa: make vdpa_bus const
authorRicardo B. Marliere <ricardo@marliere.net>
Sun, 4 Feb 2024 20:50:45 +0000 (17:50 -0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 19 Mar 2024 06:45:50 +0000 (02:45 -0400)
Now that the driver core can properly handle constant struct bus_type,
move the vdpa_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-vdpa-v1-1-1745eccb0a5c@marliere.net>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vdpa/vdpa.c

index d069568..c73c061 100644 (file)
@@ -115,7 +115,7 @@ static const struct attribute_group vdpa_dev_group = {
 };
 __ATTRIBUTE_GROUPS(vdpa_dev);
 
-static struct bus_type vdpa_bus = {
+static const struct bus_type vdpa_bus = {
        .name  = "vdpa",
        .dev_groups = vdpa_dev_groups,
        .match = vdpa_dev_match,