workqueue: make wq_subsys const
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
@@ -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]>
Quoted 10 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move thewq_subsysvariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc Greg Kroah-Hartman <[email protected]>Suggested-by Greg Kroah-Hartman <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>--- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move thewq_subsysvariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc Greg Kroah-Hartman <[email protected]>Suggested-by Greg Kroah-Hartman <[email protected]>Signed-off-by Ricardo B. Marliere <[email protected]>
Applied to wq/for-6.9.
Thanks.
Signature · 1 line
tejun