From nobody Tue Sep 9 17:49:09 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 3863DC001B0 for ; Wed, 26 Jul 2023 14:54:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234077AbjGZOym (ORCPT ); Wed, 26 Jul 2023 10:54:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234020AbjGZOyk (ORCPT ); Wed, 26 Jul 2023 10:54:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFF451FF2 for ; Wed, 26 Jul 2023 07:54:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 61CC461B0D for ; Wed, 26 Jul 2023 14:54:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACC13C433C7; Wed, 26 Jul 2023 14:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690383278; bh=6COAuBhHi+E6Wb3ufv0iUJ71l4MhF1eap+s4qSwyeU4=; h=From:To:Cc:Subject:Date:From; b=Um6LU4UQwX8QYWM2zwHJ2pvxGQ2sJOCrDvQkIIsUMJH0MYu6M2Y98v5/TPkfwMszS uOz8UxRFkjPHsdLtcsgR6Te4Xok49IEO5sHwMIZbaxvZ1mVL/6M3kFzDUMUmwYMF1o B3Pa115+S1LpK8afkcrIOkFP3w4NyjqGvbXrOb6lM6YJbnoVG4akmhgwrKsgh1Uwr8 bGW+zq0hRuu8f/hYTbJJQeOsMTN5Dx0J+qa6woriDly0FGUCgcKtLh+ONJeIkmzgOT BwPh/tq9yd1LQt+ps/aLxLM2pgnwkLzKDr4Pkq/AVRwr4FO9SbIbcm2B2V+0ZeMdM2 xjnjLP6CgEbTA== From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , Baoquan He , linux-kernel@vger.kernel.org Subject: [PATCH] iomem: remove __weak ioremap_cache helper Date: Wed, 26 Jul 2023 16:54:09 +0200 Message-Id: <20230726145432.1617809-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann No portable code calls into this function any more, and on architectures that don't use or define their own, it causes a warning: kernel/iomem.c:10:22: warning: no previous prototype for 'ioremap_cache' [-= Wmissing-prototypes] 10 | __weak void __iomem *ioremap_cache(resource_size_t offset, unsigned= long size) Fold it into the only caller that uses it on architectures without the #define. Note that the fallback to ioremap is probably still wrong on those architectures, but this is what it's always done there. Signed-off-by: Arnd Bergmann Reviewed-by: Baoquan He Reviewed-by: Christoph Hellwig --- kernel/iomem.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/kernel/iomem.c b/kernel/iomem.c index 9682471e64717..dc2120776e1c3 100644 --- a/kernel/iomem.c +++ b/kernel/iomem.c @@ -5,18 +5,14 @@ #include #include =20 -#ifndef ioremap_cache -/* temporary while we convert existing ioremap_cache users to memremap */ -__weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long s= ize) -{ - return ioremap(offset, size); -} -#endif - #ifndef arch_memremap_wb static void *arch_memremap_wb(resource_size_t offset, unsigned long size) { +#ifdef ioremap_cache return (__force void *)ioremap_cache(offset, size); +#else + return (__force void *)ioremap(offset, size); +#endif } #endif =20 --=20 2.39.2