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

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: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/ec93ed1b28b75674ae9a0b42de083a9bb140f0b3.1694613528.git.geert@linux-m68k.org

+7 -16
+7 -1
arch/m68k/include/asm/dvma.h
··· 58 58 #define dvma_vtob(x) dvma_vtop(x) 59 59 #define dvma_btov(x) dvma_ptov(x) 60 60 61 + void sun3_dvma_init(void); 62 + 61 63 static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, 62 64 int len) 63 65 { 64 66 return 0; 65 67 } 68 + 69 + static inline void dvma_unmap_iommu(unsigned long baddr, int len) { } 66 70 67 71 #else /* Sun3x */ 68 72 ··· 82 78 #define dvma_vtob(x) ((unsigned long)(x) & 0x00ffffff) 83 79 #define dvma_btov(x) ((unsigned long)(x) | 0xff000000) 84 80 85 - extern int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); 81 + static inline void sun3_dvma_init(void) { } 86 82 83 + int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); 87 84 85 + void dvma_unmap_iommu(unsigned long baddr, int len); 88 86 89 87 /* everything below this line is specific to dma used for the onboard 90 88 ESP scsi on sun3x */
-15
arch/m68k/sun3/sun3dvma.c
··· 20 20 21 21 #undef DVMA_DEBUG 22 22 23 - #ifdef CONFIG_SUN3X 24 - extern void dvma_unmap_iommu(unsigned long baddr, int len); 25 - #else 26 - static inline void dvma_unmap_iommu(unsigned long a, int b) 27 - { 28 - } 29 - #endif 30 - 31 - #ifdef CONFIG_SUN3 32 - extern void sun3_dvma_init(void); 33 - #endif 34 - 35 23 static unsigned long *iommu_use; 36 24 37 25 #define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT) ··· 262 274 263 275 dvma_unmap_iommu(DVMA_START, DVMA_SIZE); 264 276 265 - #ifdef CONFIG_SUN3 266 277 sun3_dvma_init(); 267 - #endif 268 - 269 278 } 270 279 271 280 unsigned long dvma_map_align(unsigned long kaddr, int len, int align)