Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc32: remove custom definition of mk_pte()

Instead of defining pfn_pte() in terms of mk_pte(), make pfn_pte() the
base implementation. That lets us use the generic definition of mk_pte().

Link: https://lkml.kernel.org/r/20250402181709.2386022-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Zi Yan <ziy@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Richard Weinberger <richard@nod.at>
Cc: <x86@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
aec44171 cb5b13cd

+5 -10
+5 -10
arch/sparc/include/asm/pgtable_32.h
··· 255 255 } 256 256 257 257 #define PFN_PTE_SHIFT (PAGE_SHIFT - 4) 258 - #define pfn_pte(pfn, prot) mk_pte(pfn_to_page(pfn), prot) 258 + 259 + static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) 260 + { 261 + return __pte((pfn << PFN_PTE_SHIFT) | pgprot_val(pgprot)); 262 + } 259 263 260 264 static inline unsigned long pte_pfn(pte_t pte) 261 265 { ··· 275 271 } 276 272 277 273 #define pte_page(pte) pfn_to_page(pte_pfn(pte)) 278 - 279 - /* 280 - * Conversion functions: convert a page and protection to a page entry, 281 - * and a page entry and page directory to the page they refer to. 282 - */ 283 - static inline pte_t mk_pte(struct page *page, pgprot_t pgprot) 284 - { 285 - return __pte((page_to_pfn(page) << (PAGE_SHIFT-4)) | pgprot_val(pgprot)); 286 - } 287 274 288 275 static inline pte_t mk_pte_phys(unsigned long page, pgprot_t pgprot) 289 276 {