* [PATCH] perf: make pmu_bus const
@ 2024-02-04 13:29 Ricardo B. Marliere
2024-02-04 14:25 ` Greg Kroah-Hartman
2024-02-05 10:59 ` Mark Rutland
0 siblings, 2 replies; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 13:29 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Ian Rogers, Adrian Hunter
Cc: linux-perf-users, linux-kernel, Greg Kroah-Hartman,
Ricardo B. Marliere
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>
---
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 59b332cce9e7..decd994bfca4 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -11434,7 +11434,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,
};
---
base-commit: fdd041028f2294228e10610b4fca6a1a83ac683d
change-id: 20240204-bus_cleanup-events-765165264090
Best regards,
--
Ricardo B. Marliere <ricardo@marliere.net>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf: make pmu_bus const
2024-02-04 13:29 [PATCH] perf: make pmu_bus const Ricardo B. Marliere
@ 2024-02-04 14:25 ` Greg Kroah-Hartman
2024-02-05 10:59 ` Mark Rutland
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-04 14:25 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Ian Rogers, Adrian Hunter, linux-perf-users, linux-kernel
On Sun, Feb 04, 2024 at 10:29:39AM -0300, Ricardo B. Marliere wrote:
> 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>
> ---
> kernel/events/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf: make pmu_bus const
2024-02-04 13:29 [PATCH] perf: make pmu_bus const Ricardo B. Marliere
2024-02-04 14:25 ` Greg Kroah-Hartman
@ 2024-02-05 10:59 ` Mark Rutland
1 sibling, 0 replies; 3+ messages in thread
From: Mark Rutland @ 2024-02-05 10:59 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Alexander Shishkin, Jiri Olsa, Namhyung Kim, Ian Rogers,
Adrian Hunter, linux-perf-users, linux-kernel, Greg Kroah-Hartman
On Sun, Feb 04, 2024 at 10:29:39AM -0300, Ricardo B. Marliere wrote:
> 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>
Mark.
> ---
> 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 59b332cce9e7..decd994bfca4 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -11434,7 +11434,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,
> };
>
> ---
> base-commit: fdd041028f2294228e10610b4fca6a1a83ac683d
> change-id: 20240204-bus_cleanup-events-765165264090
>
> Best regards,
> --
> Ricardo B. Marliere <ricardo@marliere.net>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-05 10:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 13:29 [PATCH] perf: make pmu_bus const Ricardo B. Marliere
2024-02-04 14:25 ` Greg Kroah-Hartman
2024-02-05 10:59 ` Mark Rutland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox