]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf: make pmu_bus const
authorRicardo B. Marliere <ricardo@marliere.net>
Sun, 4 Feb 2024 13:29:39 +0000 (10:29 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Sep 2025 14:01:37 +0000 (16:01 +0200)
Now that the driver core can properly handle constant struct bus_type,
move the pmu_bus 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>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-events-v1-1-c779d1639c3a@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/events/core.c

index 872122e074e5fe4b29e2bfde84f5ffcd384743fc..155bb686c8ceba6154e81ca4a8fcd8d3b1c53531 100644 (file)
@@ -12216,7 +12216,7 @@ static const struct attribute_group *pmu_dev_groups[] = {
 };
 
 static int pmu_bus_running;
-static struct bus_type pmu_bus = {
+static const struct bus_type pmu_bus = {
        .name           = "event_source",
        .dev_groups     = pmu_dev_groups,
 };