[PATCH] arch: powerpc: ps3: Make ps3_system_bus_type const

Adrian Barnaś posted 1 patch 1 week, 6 days ago
arch/powerpc/platforms/ps3/system-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] arch: powerpc: ps3: Make ps3_system_bus_type const
Posted by Adrian Barnaś 1 week, 6 days ago
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.

Signed-off-by: Adrian Barnaś <abarnas@google.com>
---
 arch/powerpc/platforms/ps3/system-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index afbaabf182d0..c5b880c411ef 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -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,
-- 
2.51.0.470.ga7dc726c21-goog
Re: [PATCH] arch: powerpc: ps3: Make ps3_system_bus_type const
Posted by Geert Uytterhoeven 1 week, 5 days ago
On Thu, 18 Sept 2025 at 13:49, Adrian Barnaś <abarnas@google.com> wrote:
> 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.
>
> Signed-off-by: Adrian Barnaś <abarnas@google.com>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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
Re: [PATCH] arch: powerpc: ps3: Make ps3_system_bus_type const
Posted by Greg Kroah-Hartman 1 week, 6 days ago
On Thu, Sep 18, 2025 at 11:48:40AM +0000, Adrian Barnaś wrote:
> 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.
> 
> Signed-off-by: Adrian Barnaś <abarnas@google.com>
> ---
>  arch/powerpc/platforms/ps3/system-bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>