mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
rv/monitors: Move monitor structure in rodata
It makes sense to move the important monitor structure into rodata to prevent accidental structure modification. Link: https://lkml.kernel.org/r/20221122173648.4732-1-acarmina@redhat.com Signed-off-by: Alessandro Carminati <acarmina@redhat.com> Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
parent
eb9d58947d
commit
bfa87ac86c
@ -27,7 +27,7 @@ struct automaton_wip {
|
|||||||
bool final_states[state_max_wip];
|
bool final_states[state_max_wip];
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct automaton_wip automaton_wip = {
|
static const struct automaton_wip automaton_wip = {
|
||||||
.state_names = {
|
.state_names = {
|
||||||
"preemptive",
|
"preemptive",
|
||||||
"non_preemptive"
|
"non_preemptive"
|
||||||
|
@ -27,7 +27,7 @@ struct automaton_wwnr {
|
|||||||
bool final_states[state_max_wwnr];
|
bool final_states[state_max_wwnr];
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct automaton_wwnr automaton_wwnr = {
|
static const struct automaton_wwnr automaton_wwnr = {
|
||||||
.state_names = {
|
.state_names = {
|
||||||
"not_running",
|
"not_running",
|
||||||
"running"
|
"running"
|
||||||
|
@ -111,7 +111,7 @@ class Dot2c(Automata):
|
|||||||
|
|
||||||
def format_aut_init_header(self):
|
def format_aut_init_header(self):
|
||||||
buff = []
|
buff = []
|
||||||
buff.append("static struct %s %s = {" % (self.struct_automaton_def, self.var_automaton_def))
|
buff.append("static const struct %s %s = {" % (self.struct_automaton_def, self.var_automaton_def))
|
||||||
return buff
|
return buff
|
||||||
|
|
||||||
def __get_string_vector_per_line_content(self, buff):
|
def __get_string_vector_per_line_content(self, buff):
|
||||||
|
Loading…
Reference in New Issue
Block a user