Skip to content

Commit bfa87ac

Browse files
alessandrocarminatirostedt
authored andcommitted
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/[email protected] Signed-off-by: Alessandro Carminati <[email protected]> Acked-by: Daniel Bristot de Oliveira <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent eb9d589 commit bfa87ac

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

kernel/trace/rv/monitors/wip/wip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct automaton_wip {
2727
bool final_states[state_max_wip];
2828
};
2929

30-
static struct automaton_wip automaton_wip = {
30+
static const struct automaton_wip automaton_wip = {
3131
.state_names = {
3232
"preemptive",
3333
"non_preemptive"

kernel/trace/rv/monitors/wwnr/wwnr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct automaton_wwnr {
2727
bool final_states[state_max_wwnr];
2828
};
2929

30-
static struct automaton_wwnr automaton_wwnr = {
30+
static const struct automaton_wwnr automaton_wwnr = {
3131
.state_names = {
3232
"not_running",
3333
"running"

tools/verification/dot2/dot2c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def format_automaton_definition(self):
111111

112112
def format_aut_init_header(self):
113113
buff = []
114-
buff.append("static struct %s %s = {" % (self.struct_automaton_def, self.var_automaton_def))
114+
buff.append("static const struct %s %s = {" % (self.struct_automaton_def, self.var_automaton_def))
115115
return buff
116116

117117
def __get_string_vector_per_line_content(self, buff):

0 commit comments

Comments
 (0)