Skip to contentSkip to conversation

arch: powerpc: ps3: Make ps3_system_bus_type const

PATCH In review Adrian Barnaś 3 participants 3 messages Sep 18, 2025 – Sep 19, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch: powerpc: ps3: Make ps3_system_bus_type const

Because driver core can properly handle constant struct bus_type, move the ps3_system_bus_type to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.

---
 arch/powerpc/platforms/ps3/system-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/ps3/system-bus.c +1 -1
index afbaabf182d0..c5b880c411ef 100644
@@ -465,7 +465,7 @@ static struct attribute *ps3_system_bus_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(ps3_system_bus_dev);
 
-static struct bus_type ps3_system_bus_type = {
+static const struct bus_type ps3_system_bus_type = {
 	.name = "ps3_system_bus",
 	.match = ps3_system_bus_match,
 	.uevent = ps3_system_bus_uevent,
Signature · 1 line
2.51.0.470.ga7dc726c21-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Adrian Barnaś

Because driver core can properly handle constant struct bus_type, move the ps3_system_bus_type to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.

---
 arch/powerpc/platforms/ps3/system-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Adrian Barnaś
Quoted 5 lines · Adrian Barnaś

Because driver core can properly handle constant struct bus_type, move the ps3_system_bus_type to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds