[tip:,timers/core] clocksource: Make clocksource_subsys const

Message ID 170731561942.398.5422557140966598380.tip-bot2@tip-bot2
State New
Headers
Series [tip:,timers/core] clocksource: Make clocksource_subsys const |

Commit Message

tip-bot2 for Thomas Gleixner Feb. 7, 2024, 2:20 p.m. UTC
  The following commit has been merged into the timers/core branch of tip:

Commit-ID:     2bc7fc24f9a85cb6b7335354b2733615727689f6
Gitweb:        https://git.kernel.org/tip/2bc7fc24f9a85cb6b7335354b2733615727689f6
Author:        Ricardo B. Marliere <ricardo@marliere.net>
AuthorDate:    Sun, 04 Feb 2024 10:40:15 -03:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 07 Feb 2024 15:11:24 +01:00

clocksource: Make clocksource_subsys const

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

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-time-v1-1-207ec18e24b8@marliere.net
---
 kernel/time/clocksource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 3052b1f..4ef0665 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -1468,7 +1468,7 @@  static struct attribute *clocksource_attrs[] = {
 };
 ATTRIBUTE_GROUPS(clocksource);
 
-static struct bus_type clocksource_subsys = {
+static const struct bus_type clocksource_subsys = {
 	.name = "clocksource",
 	.dev_name = "clocksource",
 };