[PATCH] workqueue: make wq_subsys const

Ricardo B. Marliere
2024-02-06T18:04:47Z

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.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
The maintainer asked [1] for this patch to be received through the
driver-core tree.
[1]: https://lore.kernel.org/all/ZcEeOueCbrltxr_b@slm.duckdns.org/
---
kernel/workqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 76e60faed892..f1e062acd091 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -6157,7 +6157,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: f297a3844aa059c53be3f69be85ebc071b8a6d16
change-id: 20240206-bus_cleanup-workqueue-1547a46532d1

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