]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
workqueue: make wq_subsys const
authorRicardo B. Marliere <ricardo@marliere.net>
Sun, 4 Feb 2024 13:47:05 +0000 (10:47 -0300)
committerTejun Heo <tj@kernel.org>
Sun, 4 Feb 2024 21:23:25 +0000 (11:23 -1000)
Now that the driver core can properly handle constant struct bus_type,
move the wq_subsys 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-and-reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c

index 55c9816506b06be3245faceacaf2bf804b002e74..695f6f5ad0382f8d52f8f4d6a90557d1c1f041db 100644 (file)
@@ -6692,7 +6692,7 @@ static struct device_attribute wq_sysfs_unbound_attrs[] = {
        __ATTR_NULL,
 };
 
-static struct bus_type wq_subsys = {
+static const struct bus_type wq_subsys = {
        .name                           = "workqueue",
        .dev_groups                     = wq_sysfs_groups,
 };