Re: [PATCH] rv/monitors: Move monitor structure in rodata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux