]> git.ipfire.org Git - thirdparty/linux.git/commit
memblock: drop redundant 'struct page *' argument from memblock_free_pages()
authorShengming Hu <hu.shengming@zte.com.cn>
Mon, 29 Dec 2025 13:52:27 +0000 (21:52 +0800)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Fri, 9 Jan 2026 09:53:51 +0000 (11:53 +0200)
commit58e3e5265484a1bf39569903630a45a924621aaa
tree1463e0cc69eb26acb9c0f81445ba8d48ac90aca2
parentbe05f571464404432a0f8fe1c81a86a0862da283
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>
mm/internal.h
mm/memblock.c
mm/mm_init.c
tools/testing/memblock/internal.h