On Thu, Feb 1, 2024, at 01:01, Yan Zhao wrote: > On Wed, Jan 31, 2024 at 12:48:38PM +0100, Arnd Bergmann wrote: >> On Wed, Jan 31, 2024, at 06:51, Yan Zhao wrote: >> >> How exactly did you notice the function being wrong, >> did you try to add a user somewhere, or just read through >> the code? > I came across them when I was debugging an unexpected kernel page fault > on x86, and I was not sure whether page_to_virt() was compiled in > asm-generic/page.h or linux/mm.h. > Though finally, it turned out that the one in linux/mm.h was used, which > yielded the right result and the unexpected kernel page fault in my case > was not related to page_to_virt(), it did lead me to noticing that the > pfn_to_virt() in asm-generic/page.h and other 3 archs did not look right. > > Yes, unlike virt_to_pfn() which still has a caller in openrisc (among > csky, Hexagon, openrisc), pfn_to_virt() now does not have a caller in > the 3 archs. Though both virt_to_pfn() and pfn_to_virt() are referenced > in asm-generic/page.h, I also not sure if we need to remove the > asm-generic/page.h which may serve as a template to future archs ? > > So, either way looks good to me :) I think it's fair to assume we won't need asm-generic/page.h any more, as we likely won't be adding new NOMMU architectures. I can have a look myself at removing any such unused headers in include/asm-generic/, it's probably not the only one. Can you just send a patch to remove the unused pfn_to_virt() functions? Arnd