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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 40D73C35671 for ; Mon, 24 Feb 2020 12:48:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 168CD20866 for ; Mon, 24 Feb 2020 12:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582548481; bh=X9JTF+JlJ3uGZ0qil4K9u4hZ1e6Fgfb8qXJKC/hhAzQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=TXv2sqSrZusFMd26UeJzH0PJ+EtLIWlN/Db0y9aQNsMrwGm6+NrX79EEkI2oUS6Ol /MhvZrspEkgFtpl00bm6DEYc/Jv09wLy7nR8RBrb/4sYiK3x4mYBL4pD0EWHDS+aOy xzKaqurUP6O/jz+LkKfDMfBzw+/+bhFVads86RgY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727444AbgBXMrx convert rfc822-to-8bit (ORCPT ); Mon, 24 Feb 2020 07:47:53 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:36492 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbgBXMrw (ORCPT ); Mon, 24 Feb 2020 07:47:52 -0500 Received: by mail-ed1-f67.google.com with SMTP id j17so11757997edp.3; Mon, 24 Feb 2020 04:47:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=6p1Rm/cgq3FqTcHGA+7QXUNsBMb6waSsaCWakkpOhMI=; b=KevIibRzjYHkz7b3z6zkclYIBEKkafAUwE0AyTYxwKkMUyb291I/ISo9i/2pJpdEN5 E7UTE6jq2iIK+vPwAx8KGjc42VQoQD5Ntf+jqooSbNMmjOHP+3JOcQ/Lrsrj325oAnEi +ouDUf8DvLtsQsUnNfxkgk2/12MLSptugXSzI2yQA9Sh20Rw3wm6lpERRHqRRmmxgrJe 1hW0w2XoDojno+hlDHbVVrYTRgezXrfJij2GDVSstbFmSOpVmpKDmSjVMER8vCabCfEQ X1HixIwZkQZLTGTfzNCVP99iMk0IXXLQzMv8GAD2THs12N4gBuJfpJdKFA3V3XFM+MYB VOww== X-Gm-Message-State: APjAAAUo/2ViXnpSnrWar8ORCQBgfeHSnsSGfxcYNqZLmKw9eEIGVNQY h5SDppDFpaq1um3eKVv6IDQ= X-Google-Smtp-Source: APXvYqxOCnjuqHzZ8w9dppB5X8CKpWu3LAO4qx3F7JuCo/1tjWWY0qRzHXx7PYmPGsjZ1wOThemeng== X-Received: by 2002:a17:906:7fd0:: with SMTP id r16mr45290488ejs.319.1582548468870; Mon, 24 Feb 2020 04:47:48 -0800 (PST) Received: from pi3 ([194.230.155.125]) by smtp.googlemail.com with ESMTPSA id n19sm944550edy.9.2020.02.24.04.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 04:47:48 -0800 (PST) Date: Mon, 24 Feb 2020 13:47:44 +0100 From: Krzysztof Kozlowski To: Jiri Slaby Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Geert Uytterhoeven , Andrew Morton , Thomas Gleixner , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Subject: Re: [RESEND PATCH v2 9/9] ath5k: Constify ioreadX() iomem argument (as in generic implementation) Message-ID: <20200224124744.GA1949@pi3> References: <20200219175007.13627-1-krzk@kernel.org> <20200219175007.13627-10-krzk@kernel.org> <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Thu, Feb 20, 2020 at 10:48:33AM +0100, Jiri Slaby wrote: > On 19. 02. 20, 18:50, 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 > > Acked-by: Kalle Valo > > --- > > drivers/net/wireless/ath/ath5k/ahb.c | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c > > index 2c9cec8b53d9..8bd01df369fb 100644 > > --- a/drivers/net/wireless/ath/ath5k/ahb.c > > +++ b/drivers/net/wireless/ath/ath5k/ahb.c > > @@ -138,18 +138,18 @@ static int ath_ahb_probe(struct platform_device *pdev) > > > > if (bcfg->devid >= AR5K_SREV_AR2315_R6) { > > /* Enable WMAC AHB arbitration */ > > - reg = ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); > > + reg = ioread32((const void __iomem *) AR5K_AR2315_AHB_ARB_CTL); > > While I understand why the parameter of ioread32 should be const, I > don't see a reason for these casts on the users' side. What does it > bring except longer code to read? Because the argument is an int: drivers/net/wireless/ath/ath5k/ahb.c: In function ‘ath_ahb_probe’: drivers/net/wireless/ath/ath5k/ahb.c:141:18: warning: passing argument 1 of ‘ioread32’ makes pointer from integer without a cast [-Wint-conversion] reg = ioread32(AR5K_AR2315_AHB_ARB_CTL); Best regards, Krzysztof