[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7febf4f5-88d9-7902-e231-af2b6d0d6df0@kernel.org>
Date: Tue, 22 Nov 2022 15:13:20 +0100
From: Daniel Bristot de Oliveira <bristot@...nel.org>
To: Alessandro Carminati <acarmina@...hat.com>,
linux-trace-devel@...r.kernel.org
Cc: alessandro.carminati@...il.com, rostedt@...dmis.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rv/monitors: Move monitor structure in rodata
On 11/18/22 17:20, Alessandro Carminati wrote:
> It makes sense to move the important monitor structure into rodata to
> prevent accidental structure modification.
>
> Signed-off-by: Alessandro Carminati <acarmina@...hat.com>
> ---
> kernel/trace/rv/monitors/wip/wip.h | 2 +-
> kernel/trace/rv/monitors/wwnr/wwnr.h | 2 +-
> tools/verification/dot2/dot2c.py | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/rv/monitors/wip/wip.h b/kernel/trace/rv/monitors/wip/wip.h
> index dacc37b62a2c..9c0cd0ad5cd7 100644
> --- a/kernel/trace/rv/monitors/wip/wip.h
> +++ b/kernel/trace/rv/monitors/wip/wip.h
> @@ -27,7 +27,7 @@ struct automaton_wip {
> bool final_states[state_max_wip];
> };
>
> -static struct automaton_wip automaton_wip = {
> +const static struct automaton_wip automaton_wip = {
> .state_names = {
> "preemptive",
> "non_preemptive"
> diff --git a/kernel/trace/rv/monitors/wwnr/wwnr.h b/kernel/trace/rv/monitors/wwnr/wwnr.h
checkpatch says:
WARNING: Move const after static - use 'static const struct automaton_wip '
#32: FILE: kernel/trace/rv/monitors/wip/wip.h:30:
+const static struct automaton_wip automaton_wip = {
WARNING: Move const after static - use 'static const struct automaton_wwnr '
#45: FILE: kernel/trace/rv/monitors/wwnr/wwnr.h:30:
+const static struct automaton_wwnr automaton_wwnr = {
and this is also true for the dot2c part.
Do you mind fixing that in a v2?
-- Daniel
Powered by blists - more mailing lists