clocksource: Make clocksource_subsys const
authorRicardo B. Marliere <ricardo@marliere.net>
Sun, 4 Feb 2024 13:40:15 +0000 (10:40 -0300)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 7 Feb 2024 14:11:24 +0000 (15:11 +0100)
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

index 3052b1f1168e29c4432ba3b068488af11029018d..4ef06651ad079f7bd28fb19cabfcb3b477dab53f 100644 (file)
@@ -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",
 };