From: Rikard Falkeborn Date: Fri, 5 Nov 2021 20:41:01 +0000 (-0700) Subject: mm/memory_failure: constify static mm_walk_ops X-Git-Tag: howlett/maple/20220722_2~1907^2~140 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ba9eb3cef9e699e259f9ceefdbcd3ee83d3529e2;p=users%2Fjedix%2Flinux-maple.git 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/20211014075042.17174-3-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn Acked-by: Naoya Horiguchi Reviewed-by: Anshuman Khandual Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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, };