aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAnshuman Khandual <[email protected]>2020-06-03 15:59:17 -0700
committerLinus Torvalds <[email protected]>2020-06-03 20:09:45 -0700
commitae70eddd5633fc71dccf210f237c5aefc96f4332 (patch)
tree9194a759aa0799e2f654340f6a7bfaf7ff5b88d7 /include/linux
parentaa09259109583b98b9d9e7ed0d8eb1b880d1eb97 (diff)
mm/page_alloc: restrict and formalize compound_page_dtors[]
Restrict elements in compound_page_dtors[] array per NR_COMPOUND_DTORS and explicitly position them according to enum compound_dtor_id. This improves protection against possible misalignment between compound_page_dtors[] and enum compound_dtor_id later on. Signed-off-by: Anshuman Khandual <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4141ebcb3a65..32f3c17715ac 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -867,7 +867,7 @@ enum compound_dtor_id {
#endif
NR_COMPOUND_DTORS,
};
-extern compound_page_dtor * const compound_page_dtors[];
+extern compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS];
static inline void set_compound_page_dtor(struct page *page,
enum compound_dtor_id compound_dtor)