2024-02-04 14:25:46

by Ricardo B. Marliere

[permalink] [raw]
Subject: [PATCH] s390: time: make stp_subsys const

Now that the driver core can properly handle constant struct bus_type,
move the stp_subsys variable 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]>
---
arch/s390/kernel/time.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 14abad953c02..39a42369389c 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -716,7 +716,7 @@ static void stp_work_fn(struct work_struct *work)
/*
* STP subsys sysfs interface functions
*/
-static struct bus_type stp_subsys = {
+static const struct bus_type stp_subsys = {
.name = "stp",
.dev_name = "stp",
};

---
base-commit: 8eb3db95a8c8ecd6f8bb082a99ded3bbc79b023f
change-id: 20240204-bus_cleanup-s390_time-cf8851bbc1dc

Best regards,
--
Ricardo B. Marliere <[email protected]>



2024-02-04 14:38:38

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] s390: time: make stp_subsys const

On Sun, Feb 04, 2024 at 11:25:45AM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the stp_subsys variable 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]>
> ---
> arch/s390/kernel/time.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Greg Kroah-Hartman <[email protected]>

2024-02-06 08:32:47

by Heiko Carstens

[permalink] [raw]
Subject: Re: [PATCH] s390: time: make stp_subsys const

On Sun, Feb 04, 2024 at 11:25:45AM -0300, Ricardo B. Marliere wrote:
1;115;0c> Now that the driver core can properly handle constant struct bus_type,
> move the stp_subsys variable 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]>
> ---
> arch/s390/kernel/time.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks!