From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 124ADC33C9B for ; Wed, 8 Jan 2020 08:10:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCFA2206DA for ; Wed, 8 Jan 2020 08:10:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k0PV/w+D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCFA2206DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QEwyXPr6f/ZqKoVyNtKG6eeK7hTLd0isQKC9YLkF6TA=; b=k0PV/w+D9sTIi3 ZG3KZlM6Qcp4gR20GMnhgeW3Rixp47yRppWz7gPE+HjOR9LaLEC892LgePEBRlRwqCS/jK3FzkgqD wj+ISVVPwY1e6Y/JFrOIF7+PWvI72x3LLD5/TLjm2QJdI4IROp5XLTepCn7nbQxzPktURn3kKOEeG BGgZ3246lWiZa6sjsppywFWBrfCMtnIyIlDY19tVUSXcMRnBm5BJ+rlMORg2FKeCSGHwJOnThRfwJ 9aY3RfJRYuIeyUAKb5WSVNSEvDmv1UbwjjDQpfCi0vxobCJFIWFPOeN0EQA+UNsz6Gqkn4SPDNcGF 46TcSzCTse/ZHQRaak4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ip6Q0-00080X-RV; Wed, 08 Jan 2020 08:10:20 +0000 Received: from mail-oi1-f196.google.com ([209.85.167.196]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ip6Py-000803-G2 for linux-snps-arc@lists.infradead.org; Wed, 08 Jan 2020 08:10:19 +0000 Received: by mail-oi1-f196.google.com with SMTP id l136so1916351oig.1 for ; Wed, 08 Jan 2020 00:10:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zSvatSaXmaDcygklTO+AiD7URC1DncR275ZO9qcviaY=; b=LlHtJ/jjuEVbPxATz8A6BJ6G7a2ImlKhNKVVfM7pK/66yZGMeT/S4DQevowSJe3/PS tGu7oYSqwVg4djRTJkoXyDJStdNuP/SBt15UKxCc6rcLuMzkQcAYGYUnVTl6czJcmIPI TZjvii5caOdZZJHk6wUmLv2ZRD7OjSSc/ccJRlzUkzxPaf4k2wVHSc8Onrht3+F3K5w8 YHoGN4BUalwztY+aboj7vT5hYFgqoEbnjsutlLsOl1U7jwK5bh3ZzpzjorMoAWpFTYyI ETMn8xg6RGvQZOq+ejumkiOpI6anwPVqyqWmShRmdUU39NSiAH7+WjS8vTQzW9MBLwQL iaYA== X-Gm-Message-State: APjAAAUKYTNiRkbonRjI42gxY2HG/N7zcyU3e+rOa/L60a7+lxoQiMup 3uUiPDfyMHhKN6al40d1ikfZEQyDN7l8SoqjO10= X-Google-Smtp-Source: APXvYqx7mMV6iu/aCjHaPWwxCajM/7EbWdhdn3wdjlil8XEXHsid4BFGqUofVL4JHvNq7QwetgrnnLwPgZu0svS796A= X-Received: by 2002:a05:6808:292:: with SMTP id z18mr2042282oic.131.1578471017446; Wed, 08 Jan 2020 00:10:17 -0800 (PST) MIME-Version: 1.0 References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <1578415992-24054-3-git-send-email-krzk@kernel.org> In-Reply-To: <1578415992-24054-3-git-send-email-krzk@kernel.org> From: Geert Uytterhoeven Date: Wed, 8 Jan 2020 09:10:06 +0100 Message-ID: Subject: Re: [RFT 02/13] alpha: Constify ioreadX() iomem argument (as in generic implementation) To: Krzysztof Kozlowski X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200108_001018_535540_F3B50140 X-CRM114-Status: GOOD ( 13.17 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , Benjamin Herrenschmidt , Jason Wang , DRI Development , virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Michael Ellerman , Helge Deller , Linux-sh list , Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , alpha , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , Vineet Gupta , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Daniel Vetter , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org Hi Krzysztof, On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski wrote: > The ioreadX() helpers have inconsistent interface. On some architectures > void *__iomem address argument is a pointer to const, on some not. > > Implementations of ioreadX() do not modify the memory under the address > so they can be converted to a "const" version for const-safety and > consistency among architectures. > > Signed-off-by: Krzysztof Kozlowski > --- a/arch/alpha/include/asm/io.h > +++ b/arch/alpha/include/asm/io.h > @@ -151,9 +151,9 @@ static inline void generic_##NAME(TYPE b, QUAL void __iomem *addr) \ > alpha_mv.mv_##NAME(b, addr); \ > } > > -REMAP1(unsigned int, ioread8, /**/) > -REMAP1(unsigned int, ioread16, /**/) > -REMAP1(unsigned int, ioread32, /**/) > +REMAP1(unsigned int, ioread8, const) > +REMAP1(unsigned int, ioread16, const) > +REMAP1(unsigned int, ioread32, const) If these would become "const volatile", there would no longer be a need for the last parameter of the REMAP1() macro. > REMAP1(u8, readb, const volatile) > REMAP1(u16, readw, const volatile) > REMAP1(u32, readl, const volatile) Same for REMAP2() macro below, for iowrite*(). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc