Skip to contentSkip to conversation

workqueue: make wq_subsys const

PATCH Applied Ricardo B. Marliere 3 participants 3 messages Feb 4, 2024 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: make wq_subsys const

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.

---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
index ffb625db9771..09caa1a34630 100644
@@ -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,

Signature · 1 line
Ricardo B. Marliere <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Ricardo B. Marliere

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.

---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
maintainer Applied
#2 lore raw
In reply to Ricardo B. Marliere
Quoted 7 lines · Ricardo B. Marliere

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.

Applied to wq/for-6.9.

Thanks.

Signature · 1 line
tejun