Commit 4ebe8459 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven

m68k: sun3: Improve Sun3/3x DVMA abstraction in <asm/dvma.h>

When building with W=1:

    arch/m68k/sun3/dvma.c:65:13: warning: no previous prototype for ‘sun3_dvma_init’ [-Wmissing-prototypes]
       65 | void __init sun3_dvma_init(void)
	  |             ^~~~~~~~~~~~~~

    arch/m68k/sun3x/dvma.c:178:6: warning: no previous prototype for ‘dvma_unmap_iommu’ [-Wmissing-prototypes]
      179 | void dvma_unmap_iommu(unsigned long baddr, int len)
	  |      ^~~~~~~~~~~~~~~~

Fix this by moving the declarations for sun3_dvma_init() and
dvma_unmap_iommu() to <asm/dvma.h>.  Avoid #ifdefs in callers by
providing dummy static inline functions.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/ec93ed1b28b75674ae9a0b42de083a9bb140f0b3.1694613528.git.geert@linux-m68k.org
parent 2926da2b
...@@ -58,12 +58,16 @@ extern void dvma_free(void *vaddr); ...@@ -58,12 +58,16 @@ extern void dvma_free(void *vaddr);
#define dvma_vtob(x) dvma_vtop(x) #define dvma_vtob(x) dvma_vtop(x)
#define dvma_btov(x) dvma_ptov(x) #define dvma_btov(x) dvma_ptov(x)
void sun3_dvma_init(void);
static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr,
int len) int len)
{ {
return 0; return 0;
} }
static inline void dvma_unmap_iommu(unsigned long baddr, int len) { }
#else /* Sun3x */ #else /* Sun3x */
/* sun3x dvma page support */ /* sun3x dvma page support */
...@@ -78,9 +82,11 @@ static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, ...@@ -78,9 +82,11 @@ static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr,
#define dvma_vtob(x) ((unsigned long)(x) & 0x00ffffff) #define dvma_vtob(x) ((unsigned long)(x) & 0x00ffffff)
#define dvma_btov(x) ((unsigned long)(x) | 0xff000000) #define dvma_btov(x) ((unsigned long)(x) | 0xff000000)
extern int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); static inline void sun3_dvma_init(void) { }
int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len);
void dvma_unmap_iommu(unsigned long baddr, int len);
/* everything below this line is specific to dma used for the onboard /* everything below this line is specific to dma used for the onboard
ESP scsi on sun3x */ ESP scsi on sun3x */
......
...@@ -20,18 +20,6 @@ ...@@ -20,18 +20,6 @@
#undef DVMA_DEBUG #undef DVMA_DEBUG
#ifdef CONFIG_SUN3X
extern void dvma_unmap_iommu(unsigned long baddr, int len);
#else
static inline void dvma_unmap_iommu(unsigned long a, int b)
{
}
#endif
#ifdef CONFIG_SUN3
extern void sun3_dvma_init(void);
#endif
static unsigned long *iommu_use; static unsigned long *iommu_use;
#define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT) #define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
...@@ -274,10 +262,7 @@ void __init dvma_init(void) ...@@ -274,10 +262,7 @@ void __init dvma_init(void)
dvma_unmap_iommu(DVMA_START, DVMA_SIZE); dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
#ifdef CONFIG_SUN3
sun3_dvma_init(); sun3_dvma_init();
#endif
} }
unsigned long dvma_map_align(unsigned long kaddr, int len, int align) unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
......
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