From nobody Mon Dec 15 02:55:43 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB9C0EDEC5C for ; Wed, 13 Sep 2023 14:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241691AbjIMOKq (ORCPT ); Wed, 13 Sep 2023 10:10:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241456AbjIMOJs (ORCPT ); Wed, 13 Sep 2023 10:09:48 -0400 Received: from cantor.telenet-ops.be (cantor.telenet-ops.be [IPv6:2a02:1800:120:4::f00:10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04B202109 for ; Wed, 13 Sep 2023 07:08:53 -0700 (PDT) Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by cantor.telenet-ops.be (Postfix) with ESMTPS id 4Rm2PG2qljz4wwdj for ; Wed, 13 Sep 2023 16:08:50 +0200 (CEST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:f674:9611:cd05:f25a]) by xavier.telenet-ops.be with bizsmtp id lS8p2A0063fvA4V01S8p3f; Wed, 13 Sep 2023 16:08:50 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qgQXe-003ctO-Ag; Wed, 13 Sep 2023 16:08:47 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qgQXv-00FV6Q-LK; Wed, 13 Sep 2023 16:08:47 +0200 From: Geert Uytterhoeven To: linux-m68k@lists.linux-m68k.org Cc: Arnd Bergmann , Finn Thain , Michael Schmitz , Philip Blundell , Greg Ungerer , Joshua Thompson , Sam Creasey , Laurent Vivier , linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 38/52] m68k: sun3: Improve Sun3/3x DVMA abstraction in Date: Wed, 13 Sep 2023 16:08:28 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building with W=3D1: arch/m68k/sun3/dvma.c:65:13: warning: no previous prototype for =E2=80= =98sun3_dvma_init=E2=80=99 [-Wmissing-prototypes] 65 | void __init sun3_dvma_init(void) | ^~~~~~~~~~~~~~ arch/m68k/sun3x/dvma.c:178:6: warning: no previous prototype for =E2=80= =98dvma_unmap_iommu=E2=80=99 [-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 . Avoid #ifdefs in callers by providing dummy static inline functions. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann --- v2: - Add Acked-by. --- arch/m68k/include/asm/dvma.h | 8 +++++++- arch/m68k/sun3/sun3dvma.c | 15 --------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/arch/m68k/include/asm/dvma.h b/arch/m68k/include/asm/dvma.h index f609ec1de36d0d2c..d1d66d04844d3e1c 100644 --- a/arch/m68k/include/asm/dvma.h +++ b/arch/m68k/include/asm/dvma.h @@ -58,12 +58,16 @@ extern void dvma_free(void *vaddr); #define dvma_vtob(x) dvma_vtop(x) #define dvma_btov(x) dvma_ptov(x) =20 +void sun3_dvma_init(void); + static inline int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len) { return 0; } =20 +static inline void dvma_unmap_iommu(unsigned long baddr, int len) { } + #else /* Sun3x */ =20 /* sun3x dvma page support */ @@ -78,9 +82,11 @@ static inline int dvma_map_cpu(unsigned long kaddr, unsi= gned long vaddr, #define dvma_vtob(x) ((unsigned long)(x) & 0x00ffffff) #define dvma_btov(x) ((unsigned long)(x) | 0xff000000) =20 -extern int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); +static inline void sun3_dvma_init(void) { } =20 +int dvma_map_cpu(unsigned long kaddr, unsigned long vaddr, int len); =20 +void dvma_unmap_iommu(unsigned long baddr, int len); =20 /* everything below this line is specific to dma used for the onboard ESP scsi on sun3x */ diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c index 4b560f4d3960c2b5..f66b2413209069f2 100644 --- a/arch/m68k/sun3/sun3dvma.c +++ b/arch/m68k/sun3/sun3dvma.c @@ -20,18 +20,6 @@ =20 #undef DVMA_DEBUG =20 -#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; =20 #define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT) @@ -274,10 +262,7 @@ void __init dvma_init(void) =20 dvma_unmap_iommu(DVMA_START, DVMA_SIZE); =20 -#ifdef CONFIG_SUN3 sun3_dvma_init(); -#endif - } =20 unsigned long dvma_map_align(unsigned long kaddr, int len, int align) --=20 2.34.1