Commit 3c62cfdd authored by Mike Rapoport's avatar Mike Rapoport Committed by Linus Torvalds

m68k: make __pfn_to_phys() and __phys_to_pfn() available for !MMU

Recent changes that obsoleted DISCONTIGMEM on m68k switched the MMU
variant to use generic definitions of __pfn_to_phys() and __phys_to_pfn(),
but missed the !MMU variant which caused a build failure:

   drivers/media/common/videobuf2/videobuf2-dma-contig.c: In function 'vb2_dc_get_userptr':
   drivers/media/common/videobuf2/videobuf2-dma-contig.c:509:5: error: implicit declaration of function '__pfn_to_phys' [-Werror=implicit-function-declaration]
     509 |     __pfn_to_phys(nums[0]), size, buf->dma_dir, 0);
         |     ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

Enable __pfn_to_phys() and __phys_to_pfn() on !MMU builds.

Link: https://lkml.kernel.org/r/20210211232202.GS299309@linux.ibm.com
Fixes: 4bfc848e ("m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM")
Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dcc0b490
...@@ -62,7 +62,7 @@ extern unsigned long _ramend; ...@@ -62,7 +62,7 @@ extern unsigned long _ramend;
#include <asm/page_no.h> #include <asm/page_no.h>
#endif #endif
#ifdef CONFIG_DISCONTIGMEM #if !defined(CONFIG_MMU) || defined(CONFIG_DISCONTIGMEM)
#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT)) #define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))
#define __pfn_to_phys(pfn) PFN_PHYS(pfn) #define __pfn_to_phys(pfn) PFN_PHYS(pfn)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment