linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Bristot de Oliveira <bristot@kernel.org>
To: Alessandro Carminati <acarmina@redhat.com>,
	linux-trace-devel@vger.kernel.org
Cc: alessandro.carminati@gmail.com, rostedt@goodmis.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rv/monitors: Move monitor structure in rodata
Date: Tue, 22 Nov 2022 15:13:20 +0100	[thread overview]
Message-ID: <7febf4f5-88d9-7902-e231-af2b6d0d6df0@kernel.org> (raw)
In-Reply-To: <20221118162033.66389-1-acarmina@redhat.com>

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@redhat.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

  reply	other threads:[~2022-11-22 14:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 16:20 [PATCH] rv/monitors: Move monitor structure in rodata Alessandro Carminati
2022-11-22 14:13 ` Daniel Bristot de Oliveira [this message]
2022-11-22 17:36   ` [PATCH v2] " Alessandro Carminati
2022-11-23  7:55     ` Daniel Bristot de Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7febf4f5-88d9-7902-e231-af2b6d0d6df0@kernel.org \
    --to=bristot@kernel.org \
    --cc=acarmina@redhat.com \
    --cc=alessandro.carminati@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).