[PATCH] workqueue: make wq_subsys const

From: Ricardo B. Marliere
Date: Sun Feb 04 2024 - 08:46:46 EST


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@xxxxxxxxxxxxxxxxxxx>
Suggested-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ricardo B. Marliere <ricardo@xxxxxxxxxxxx>
---
kernel/workqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ffb625db9771..09caa1a34630 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -6686,7 +6686,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,
};

---
base-commit: d49e20ca05ef22580bd4ae3219a31e4630f8df97
change-id: 20240204-bus_cleanup-workqueue-b5544924b8b9

Best regards,
--
Ricardo B. Marliere <ricardo@xxxxxxxxxxxx>