]> git.dujemihanovic.xyz Git - linux.git/commitdiff
mm/damon/vaddr: constify static mm_walk_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Fri, 5 Nov 2021 20:47:07 +0000 (13:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Nov 2021 20:30:45 +0000 (13:30 -0700)
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/20211014075042.17174-2-rikard.falkeborn@gmail.com
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/damon/vaddr.c

index f0aef35602dabac4b8aacae243324739f67de734..758501b8d97db6ed5d2004b37c7ed4129c029782 100644 (file)
@@ -394,7 +394,7 @@ out:
        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,
 };
 
@@ -490,7 +490,7 @@ out:
        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,
 };