s390: time: make stp_subsys const

Message ID 20240204-bus_cleanup-s390_time-v1-1-d2120156982a@marliere.net
State New
Headers
Series s390: time: make stp_subsys const |

Commit Message

Ricardo B. Marliere Feb. 4, 2024, 2:25 p.m. UTC
  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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 arch/s390/kernel/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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

Best regards,
  

Comments

Greg KH Feb. 4, 2024, 2:38 p.m. UTC | #1
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 <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---
>  arch/s390/kernel/time.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  
Heiko Carstens Feb. 6, 2024, 8:31 a.m. UTC | #2
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 <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---
>  arch/s390/kernel/time.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks!
  

Patch

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",
 };