summaryrefslogtreecommitdiff
path: root/mm/internal.h
diff options
context:
space:
mode:
authorShengming Hu <hu.shengming@zte.com.cn>2025-12-29 21:52:27 +0800
committerMike Rapoport (Microsoft) <rppt@kernel.org>2026-01-09 11:53:51 +0200
commit58e3e5265484a1bf39569903630a45a924621aaa (patch)
tree1463e0cc69eb26acb9c0f81445ba8d48ac90aca2 /mm/internal.h
parentbe05f571464404432a0f8fe1c81a86a0862da283 (diff)
downloadlinux-next-58e3e5265484a1bf39569903630a45a924621aaa.tar.gz
linux-next-58e3e5265484a1bf39569903630a45a924621aaa.zip
memblock: drop redundant 'struct page *' argument from memblock_free_pages()
memblock_free_pages() currently takes both a struct page * and the corresponding PFN. The page pointer is always derived from the PFN at call sites (pfn_to_page(pfn)), making the parameter redundant and also allowing accidental mismatches between the two arguments. Simplify the interface by removing the struct page * argument and deriving the page locally from the PFN, after the deferred struct page initialization check. This keeps the behavior unchanged while making the helper harder to misuse. Signed-off-by: Shengming Hu <hu.shengming@zte.com.cn> Reviewed-by: David Hildenbrand (Red Hat) <david@kernel.org> Link: https://patch.msgid.link/tencent_F741CE6ECC49EE099736685E60C0DBD4A209@qq.com Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Diffstat (limited to 'mm/internal.h')
-rw-r--r--mm/internal.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/internal.h b/mm/internal.h
index e430da900430..5f93ee1459d9 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -742,8 +742,7 @@ static inline void clear_zone_contiguous(struct zone *zone)
extern int __isolate_free_page(struct page *page, unsigned int order);
extern void __putback_isolated_page(struct page *page, unsigned int order,
int mt);
-extern void memblock_free_pages(struct page *page, unsigned long pfn,
- unsigned int order);
+extern void memblock_free_pages(unsigned long pfn, unsigned int order);
extern void __free_pages_core(struct page *page, unsigned int order,
enum meminit_context context);