From: Ricardo B. Marliere Date: Sun, 4 Feb 2024 13:29:39 +0000 (-0300) Subject: perf: make pmu_bus const X-Git-Tag: v6.18-rc1~172^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b5eba544a8af6826209d34daf6197b79b1333bf;p=thirdparty%2Flinux.git perf: make pmu_bus const 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 Suggested-by: Greg Kroah-Hartman Signed-off-by: "Ricardo B. Marliere" Acked-by: Mark Rutland Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20240204-bus_cleanup-events-v1-1-c779d1639c3a@marliere.net Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/events/core.c b/kernel/events/core.c index 872122e074e5f..155bb686c8ceb 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -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, };