block: rbd: make rbd_bus_type const
Subsystems (2)
PATCH 1/1 block: rbd: make rbd_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the rbd_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
--- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rbd.c +1 -1
@@ -575,7 +575,7 @@ static const struct attribute_group rbd_bus_group = { };__ATTRIBUTE_GROUPS (rbd_bus); -static struct bus_type rbd_bus_type = { +static const struct bus_type rbd_bus_type = { .name ="rbd" , .bus_groups = rbd_bus_groups, };
---
base-commit: aa826a9b19b93bf8aabc462381ae436a60b2a320
change-id: 20240204-bus_cleanup-block-9986bfea7975
Best regards,
Signature · 1 line
Ricardo B. Marliere <[email protected]>
Quoted 7 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move therbd_bus_typevariable 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]>
Great!
Quoted 23 lines
--- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/block/rbd.c +1
-2@@ -575,7 +575,7 @@ static const struct attribute_group rbd_bus_group = { };__ATTRIBUTE_GROUPS (rbd_bus); -static struct bus_type rbd_bus_type = { +static const struct bus_type rbd_bus_type = { .name ="rbd" , .bus_groups = rbd_bus_groups, }; ---base-commit:
aa826a9b19b93bf8aabc462381ae436a60b2a320
change-id: 20240204-bus_cleanup-block-9986bfea7975Best regards,
Quoted 7 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move therbd_bus_typevariable 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]>
Quoted 5 lines · Ricardo B. Marliere
Now that the driver core can properly handle constant struct
bus_type, move therbd_bus_typevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Applied, thanks!
[1/1] block: rbd: make rbd_bus_type const
commit: 052618c71c66d5de5e9b6cbcbad26932d951919c
Best regards,
Signature · 1 line
Jens Axboe