Skip to content

Commit dedb868

Browse files
committed
driver core: container: make container_subsys const
Now that the driver core can properly handle constant struct bus_type, move the container_subsys variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Link: https://lore.kernel.org/r/2023121919-chatter-grumbling-9ef3@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 32f78ab commit dedb868

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/base/container.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static int container_offline(struct device *dev)
2424
return cdev->offline ? cdev->offline(cdev) : 0;
2525
}
2626

27-
struct bus_type container_subsys = {
27+
const struct bus_type container_subsys = {
2828
.name = CONTAINER_BUS_NAME,
2929
.dev_name = CONTAINER_BUS_NAME,
3030
.online = trivial_online,

include/linux/container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <linux/device.h>
1313

1414
/* drivers/base/power/container.c */
15-
extern struct bus_type container_subsys;
15+
extern const struct bus_type container_subsys;
1616

1717
struct container_dev {
1818
struct device dev;

0 commit comments

Comments
 (0)