Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2618356iog; Mon, 20 Jun 2022 00:32:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s+MrvU9lwJP2UY7JM3pObb8jb/tyfYPAwfR+SRgLDocTNjaMSGxgQyG5JI75sEDeZJMPMN X-Received: by 2002:a05:6402:1f15:b0:435:8a5a:e69c with SMTP id b21-20020a0564021f1500b004358a5ae69cmr1477472edb.90.1655710322037; Mon, 20 Jun 2022 00:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655710322; cv=none; d=google.com; s=arc-20160816; b=MyLSrwgAd/Y1UqHuvesgZNxLN713JNM8UIURLuM1EzhNoxZB8PjnCFc5RmOeg7X6sW LGuqf0zA/UOm1A4NaFqUoSw4VA/sUcRN86k9Lw1KuiWBh9uQxVYa29Uoh8uFHD2X7uVZ h8FVNnpphE3NgW8Jgo4oxUsK9QrAieqv7qp9WPZZNhyWbO8hNelMC8stGPWQi1Ml5i0d AER4UcYVBx7jxZ5pFBK5RDxrgZggXVGEtOVqE+0sjiAKUulYxtbyu6YtY8c9BgB0TO5p mjg63z7ypLNjBYyaw0SarMajkZPh52BZWWdBdjRuxTPeE8+gXFLNNNQsEeRMuMpl6il2 sACg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=oC99+b7LOV8K2IpfhlsoTAXhepDfJxCz+QvswNdEatY=; b=FheRzkr7lLPbh1jIxOm4SFQDsS7o7mK5UQS3XxMvAGJ9SNa4Pm3y037UXM3ie71E0N gcN1szIDVx7fS2YU1i9h7EGr2dOOz5NVIfK95gZ4gikwcbnDiKdXf9+K2icO79j8KaTK eWRb0oWyUkjgnr/wOEzLu0S7ef8Kf/Jns/LbyX+drotrcwxPrQ9xpff9L8bC2qEyeOLY +So4v93v2M454n1Llm7s1dSW0CtWfQDiCVfZZzHO7x1cjyiHImwz+pfiqn5EO9vMJdzh lwJkpJugOhjvv4UHy8w6bcz15UGuKlzVw6Nc5XQnRNlE3a12EYCbqiJ6GomhxqcCeo2y jX2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020aa7d5c5000000b00435804569fesi2411230eds.442.2022.06.20.00.31.35; Mon, 20 Jun 2022 00:32:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239006AbiFTHB4 (ORCPT + 99 others); Mon, 20 Jun 2022 03:01:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237913AbiFTHBz (ORCPT ); Mon, 20 Jun 2022 03:01:55 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 210FA6268 for ; Mon, 20 Jun 2022 00:01:52 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:1949:b867:c4bf:a30a]) by andre.telenet-ops.be with bizsmtp id lK1o2700t3sdbfl01K1o0j; Mon, 20 Jun 2022 09:01:49 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1o3BPw-004lue-9r; Mon, 20 Jun 2022 09:01:48 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1o3BPv-00Cg83-Mw; Mon, 20 Jun 2022 09:01:47 +0200 From: Geert Uytterhoeven To: Yoshinori Sato , Rich Felker , Linus Torvalds , Andrew Morton Cc: Jonathan Cameron , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , kernel test robot , Christoph Hellwig Subject: [PATCH v2] sh: Convert nommu io{re,un}map() to static inline functions Date: Mon, 20 Jun 2022 09:01:43 +0200 Message-Id: <8d1b1766260961799b04035e7bc39a7f59729f72.1655708312.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recently, nommu iounmap() was converted from a static inline function to a macro again, basically reverting commit 4580ba4ad2e6b8dd ("sh: Convert iounmap() macros to inline functions"). With -Werror, this leads to build failures like: drivers/iio/adc/xilinx-ams.c: In function ‘ams_iounmap_ps’: drivers/iio/adc/xilinx-ams.c:1195:14: error: unused variable ‘ams’ [-Werror=unused-variable] 1195 | struct ams *ams = data; | ^~~ Fix this by replacing the macros for ioremap() and iounmap() by static inline functions, based on . Reported-by: kernel test robot Reported-by: Jonathan Cameron Fixes: 13f1fc870dd74713 ("sh: move the ioremap implementation out of line") Signed-off-by: Geert Uytterhoeven Acked-by: Jonathan Cameron Reviewed-by: Christoph Hellwig --- v2: - Add Acked-by, Reviewed-by. This is actually the third time this change was made, as Christoph converted iounmap() to a macro before in commit 98c90e5ea34e98bd ("sh: remove __iounmap"), reverting commit 733f0025f0fb43e3 ("sh: prevent warnings when using iounmap"). Probably sh-nommu should include , but that would require a lot more changes. --- arch/sh/include/asm/io.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index cf9a3ec32406f856..fba90e670ed41d48 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -271,8 +271,12 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, #endif /* CONFIG_HAVE_IOREMAP_PROT */ #else /* CONFIG_MMU */ -#define iounmap(addr) do { } while (0) -#define ioremap(offset, size) ((void __iomem *)(unsigned long)(offset)) +static inline void __iomem *ioremap(phys_addr_t offset, size_t size) +{ + return (void __iomem *)(unsigned long)offset; +} + +static inline void iounmap(volatile void __iomem *addr) { } #endif /* CONFIG_MMU */ #define ioremap_uc ioremap -- 2.25.1