Skip to content

Commit

Permalink
mm/damon/vaddr: constify static mm_walk_ops
Browse files Browse the repository at this point in the history
The only usage of these structs is to pass their addresses to
walk_page_range(), which takes a pointer to const mm_walk_ops as
argument.  Make them const to allow the compiler to put them in
read-only memory.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Rikard Falkeborn <[email protected]>
Reviewed-by: SeongJae Park <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rikardfalkeborn authored and torvalds committed Nov 6, 2021
1 parent c638072 commit 199b50f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/damon/vaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static int damon_mkold_pmd_entry(pmd_t *pmd, unsigned long addr,
return 0;
}

static struct mm_walk_ops damon_mkold_ops = {
static const struct mm_walk_ops damon_mkold_ops = {
.pmd_entry = damon_mkold_pmd_entry,
};

Expand Down Expand Up @@ -490,7 +490,7 @@ static int damon_young_pmd_entry(pmd_t *pmd, unsigned long addr,
return 0;
}

static struct mm_walk_ops damon_young_ops = {
static const struct mm_walk_ops damon_young_ops = {
.pmd_entry = damon_young_pmd_entry,
};

Expand Down

0 comments on commit 199b50f

Please sign in to comment.