* [PATCH 1/2] powerpc: pseries: make suspend_subsys const
2025-09-18 14:08 [PATCH 0/2] powerpc: pseries: making bus_type structures const Adrian Barnaś
@ 2025-09-18 14:08 ` Adrian Barnaś
2025-09-18 14:08 ` [PATCH 2/2] powerpc: pseries: make cmm_subsys const Adrian Barnaś
2025-09-18 16:19 ` [PATCH 0/2] powerpc: pseries: making bus_type structures const Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Adrian Barnaś @ 2025-09-18 14:08 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, linuxppc-dev, linux-kernel
Cc: Greg Kroah-Hartman, Adrian Barnaś
Because driver core can properly handle constant struct bus_type,
move the suspend_subsys 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/pseries/suspend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index 382003dfdb9a..c51db63d3e88 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -126,7 +126,7 @@ static ssize_t show_hibernate(struct device *dev,
static DEVICE_ATTR(hibernate, 0644, show_hibernate, store_hibernate);
-static struct bus_type suspend_subsys = {
+static const struct bus_type suspend_subsys = {
.name = "power",
.dev_name = "power",
};
--
2.51.0.470.ga7dc726c21-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] powerpc: pseries: make cmm_subsys const
2025-09-18 14:08 [PATCH 0/2] powerpc: pseries: making bus_type structures const Adrian Barnaś
2025-09-18 14:08 ` [PATCH 1/2] powerpc: pseries: make suspend_subsys const Adrian Barnaś
@ 2025-09-18 14:08 ` Adrian Barnaś
2025-09-18 16:19 ` [PATCH 0/2] powerpc: pseries: making bus_type structures const Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Adrian Barnaś @ 2025-09-18 14:08 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, linuxppc-dev, linux-kernel
Cc: Greg Kroah-Hartman, Adrian Barnaś
Because driver core can properly handle constant struct bus_type,
move the cmm_subsys 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/pseries/cmm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index 5e0a718d1be7..913642647fe9 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -375,7 +375,7 @@ static struct device_attribute *cmm_attrs[] = {
static DEVICE_ULONG_ATTR(simulate_loan_target_kb, 0644,
simulate_loan_target_kb);
-static struct bus_type cmm_subsys = {
+static const struct bus_type cmm_subsys = {
.name = "cmm",
.dev_name = "cmm",
};
--
2.51.0.470.ga7dc726c21-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 0/2] powerpc: pseries: making bus_type structures const
2025-09-18 14:08 [PATCH 0/2] powerpc: pseries: making bus_type structures const Adrian Barnaś
2025-09-18 14:08 ` [PATCH 1/2] powerpc: pseries: make suspend_subsys const Adrian Barnaś
2025-09-18 14:08 ` [PATCH 2/2] powerpc: pseries: make cmm_subsys const Adrian Barnaś
@ 2025-09-18 16:19 ` Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2025-09-18 16:19 UTC (permalink / raw)
To: Adrian Barnaś
Cc: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, linuxppc-dev, linux-kernel
On Thu, Sep 18, 2025 at 02:08:14PM +0000, Adrian Barnaś wrote:
> Current driver core properly handle constant bus_type structures.
> Both changes are moving bus_type structures to be constant.
> It is a part of tree clean-up from non const bus_type structures
>
> Adrian Barnaś (2):
> powerpc: pseries: make suspend_subsys const
> powerpc: pseries: make cmm_subsys const
>
> arch/powerpc/platforms/pseries/cmm.c | 2 +-
> arch/powerpc/platforms/pseries/suspend.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> --
> 2.51.0.470.ga7dc726c21-goog
>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 4+ messages in thread