Skip to content

Commit 4ebe845

Browse files
committed
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
1 parent 2926da2 commit 4ebe845

2 files changed

Lines changed: 7 additions & 16 deletions

File tree

arch/m68k/include/asm/dvma.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ extern void dvma_free(void *vaddr);
5858
#define dvma_vtob(x) dvma_vtop(x)
5959
#define dvma_btov(x) dvma_ptov(x)
6060

61+
void sun3_dvma_init(void);
62+
6163
static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr,
6264
int len)
6365
{
6466
return 0;
6567
}
6668

69+
static inline void dvma_unmap_iommu(unsigned long baddr, int len) { }
70+
6771
#else /* Sun3x */
6872

6973
/* sun3x dvma page support */
@@ -78,9 +82,11 @@ static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr,
7882
#define dvma_vtob(x) ((unsigned long)(x) & 0x00ffffff)
7983
#define dvma_btov(x) ((unsigned long)(x) | 0xff000000)
8084

81-
extern int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len);
85+
static inline void sun3_dvma_init(void) { }
8286

87+
int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len);
8388

89+
void dvma_unmap_iommu(unsigned long baddr, int len);
8490

8591
/* everything below this line is specific to dma used for the onboard
8692
ESP scsi on sun3x */

arch/m68k/sun3/sun3dvma.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@
2020

2121
#undef DVMA_DEBUG
2222

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-
3523
static unsigned long *iommu_use;
3624

3725
#define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
@@ -274,10 +262,7 @@ void __init dvma_init(void)
274262

275263
dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
276264

277-
#ifdef CONFIG_SUN3
278265
sun3_dvma_init();
279-
#endif
280-
281266
}
282267

283268
unsigned long dvma_map_align(unsigned long kaddr, int len, int align)

0 commit comments

Comments
 (0)