[PATCH] perf: make pmu_bus constant
From: Hongfu Li
Date: Mon Sep 01 2025 - 03:11:18 EST
Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type
a const *"), 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 modifie at runtime.
Signed-off-by: Hongfu Li <lihongfu@xxxxxxxxxx>
---
kernel/events/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 872122e074e5..155bb686c8ce 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,
};
--
2.25.1