| From: David Hildenbrand <david@redhat.com> |
| Subject: mm: remove nth_page() |
| Date: Mon, 1 Sep 2025 17:03:58 +0200 |
| |
| Now that all users are gone, let's remove it. |
| |
| Link: https://lkml.kernel.org/r/20250901150359.867252-38-david@redhat.com |
| Signed-off-by: David Hildenbrand <david@redhat.com> |
| Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> |
| Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
| --- |
| |
| include/linux/mm.h | 2 -- |
| tools/testing/scatterlist/linux/mm.h | 1 - |
| 2 files changed, 3 deletions(-) |
| |
| --- a/include/linux/mm.h~mm-remove-nth_page |
| +++ a/include/linux/mm.h |
| @@ -210,9 +210,7 @@ extern unsigned long sysctl_admin_reserv |
| |
| #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) |
| bool page_range_contiguous(const struct page *page, unsigned long nr_pages); |
| -#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
| #else |
| -#define nth_page(page,n) ((page) + (n)) |
| static inline bool page_range_contiguous(const struct page *page, |
| unsigned long nr_pages) |
| { |
| --- a/tools/testing/scatterlist/linux/mm.h~mm-remove-nth_page |
| +++ a/tools/testing/scatterlist/linux/mm.h |
| @@ -51,7 +51,6 @@ static inline unsigned long page_to_phys |
| |
| #define page_to_pfn(page) ((unsigned long)(page) / PAGE_SIZE) |
| #define pfn_to_page(pfn) (void *)((pfn) * PAGE_SIZE) |
| -#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
| |
| #define __min(t1, t2, min1, min2, x, y) ({ \ |
| t1 min1 = (x); \ |
| _ |