aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRikard Falkeborn <[email protected]>2021-11-05 13:41:01 -0700
committerLinus Torvalds <[email protected]>2021-11-06 13:30:38 -0700
commitba9eb3cef9e699e259f9ceefdbcd3ee83d3529e2 (patch)
treee2906912cd79e32b174963a2eab5e9852fc790c2
parent477d01fce8dacb41cae9363136ea56812e8baa59 (diff)
mm/memory_failure: constify static mm_walk_ops
The only usage of hwp_walk_ops is to pass its address to walk_page_range() which takes a pointer to const mm_walk_ops as argument. Make it const to allow the compiler to put it in read-only memory. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Rikard Falkeborn <[email protected]> Acked-by: Naoya Horiguchi <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/memory-failure.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 8376cfe0efce..54a5d28ea601 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -674,7 +674,7 @@ static int hwpoison_hugetlb_range(pte_t *ptep, unsigned long hmask,
#define hwpoison_hugetlb_range NULL
#endif
-static struct mm_walk_ops hwp_walk_ops = {
+static const struct mm_walk_ops hwp_walk_ops = {
.pmd_entry = hwpoison_pte_range,
.hugetlb_entry = hwpoison_hugetlb_range,
};