Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp232818pxb; Tue, 15 Feb 2022 12:04:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzV7kbKfxB0ycxlOERpQmhcnVOVKigOL7VXnw47YnD50MEWZkZ8+oIaoV758ATEb8byT1QB X-Received: by 2002:a05:6402:4415:: with SMTP id y21mr614969eda.162.1644955448530; Tue, 15 Feb 2022 12:04:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644955448; cv=none; d=google.com; s=arc-20160816; b=W864HKntvzD8mv18gEYS88v6J8Xaeu0iDNutOepkd+HcTlfEo3Mc/DzjCWQ2U3TKyj e+rX1OEdrExNvAG4nOpLVotjQsDvYM//01hLS/O7tlbyETS1ZRkdA29dtmwVteojtoh1 qRVPPCJOBssyqMLI9OaI0MUHRXa7k2TEphNTSWTZvBb69uXU0py8ZiBmQWEvKf+P6dyM Udc5sug2qEZM5dfhk2OvKJft03O8LKpAv/iKDqDyWzYOxb2rwCsth9YEZzII4Ezzkrhq WFeuIBv9D1AOZ8e+OoVIW8OPmKicvkTu1W8RR2lH5m9sQAbFRhbKn5nDQz4aKQ16vQyl df+g== 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=ryW71Trn5AXynEeXTcfVUZ90BfhFs5hTJ4puDMsFDJQ=; b=BevKDDxo6t3zjuWFDzQgYzUG8tzmvhMwcfPKJLf357cZGz1/83aqOqPcfFjw4bYQSn LPusNBXgzjg7F8kpmpTFBdTGlly/7+s3CaDQjmhRt4h4d1I28vItTNhlQZ6vd+CfP1Hi yjG41jg7Wido59pMURPTkibNoo7mn10g+baCRVopEJWXXOIobojoJhn5xjBOgU4V6K3Y dHSpR46zzbYkgmygiXXBpqH+LJ6Id3q4F4uDrBPpW4vAOoQ1V33dSK3x8EX2HTKUcorX agar9ixFsRnU8XxpUtUvcfqh4nuJfZ8gHAS6YKF9TJMqqgxtKiyA2ZEaA7uf7/uFrLHh 1HtQ== 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 v16si627946edc.188.2022.02.15.12.03.42; Tue, 15 Feb 2022 12:04:08 -0800 (PST) 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 S234604AbiBOIvW (ORCPT + 99 others); Tue, 15 Feb 2022 03:51:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbiBOIvW (ORCPT ); Tue, 15 Feb 2022 03:51:22 -0500 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 77BF4113AC1 for ; Tue, 15 Feb 2022 00:51:11 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:8c73:faf1:1d11:4a47]) by andre.telenet-ops.be with bizsmtp id vLr72600J3BmCM301Lr7lU; Tue, 15 Feb 2022 09:51:09 +0100 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 1nJtYB-000rJO-4t; Tue, 15 Feb 2022 09:51:07 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1nJtYA-00AkYi-Ko; Tue, 15 Feb 2022 09:51:06 +0100 From: Geert Uytterhoeven To: Yoshinori Sato , Rich Felker Cc: Christoph Hellwig , Kuninori Morimoto , kernel test robot , Jonathan Cameron , Arnd Bergmann , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] sh: Convert nommu io{re,un}map() to static inline functions Date: Tue, 15 Feb 2022 09:51:05 +0100 Message-Id: <4ed0a7a0d3fa912a5b44c451884818f2c138ef42.1644914600.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 --- 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