From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Kozlowski Subject: Re: [RESEND PATCH v2 9/9] ath5k: Constify ioreadX() iomem argument (as in generic implementation) Date: Mon, 24 Feb 2020 13:47:44 +0100 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-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> Sender: linux-alpha-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="utf-8" 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 , Kall 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Date: Mon, 24 Feb 2020 13:47:44 +0100 From: Krzysztof Kozlowski 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-arch-owner@vger.kernel.org List-ID: 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 Message-ID: <20200224124744.gT8cItfy0yNtuANvZs71lKEE2ZBg_BuzuFBb9WxSOqE@z> 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 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.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 3E54CC35671 for ; Mon, 24 Feb 2020 12:47:56 +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 051EB2072D for ; Mon, 24 Feb 2020 12:47:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uX1ktX68" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 051EB2072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h13MhI2CY/vEBDzCK7fLp3SK9Kss+43FJ83qMzU6fEI=; b=uX1ktX68Mrbsf0 EuSXoVBLZWElIxGs+Jdsj+PSsseeh/Snj4MrbhQELZL2icZh3eyW97JS3NivoSyma48+MdOTB8MXs 5RnVHWBInpO+twV09gJNXfTJXa0Wsb9Opz/2fksxc2I8ZL+hxsliD+o9N7pq+N1b4dz1eKXrsCFs+ BdjMFnVmnNKdACOqIhyQFzjaW+JRLqC8vMsfJNukylHEinYWVOnW5SVdyfldB7SCS/8DlrcGeaVty DU7eSY3Ffm2JOmQCXRLu+F03zH8+px1yqVgdxTZ8KiQWzGmeh2wVgCQubHXDZpBd3jSP4bWLj1nV5 hy2QpNBmuYk4O4xaL3Lw==; 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 1j6D9N-0005EI-OA; Mon, 24 Feb 2020 12:47:53 +0000 Received: from mail-ed1-f68.google.com ([209.85.208.68]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6D9L-0005Dz-Hg for linux-snps-arc@lists.infradead.org; Mon, 24 Feb 2020 12:47:52 +0000 Received: by mail-ed1-f68.google.com with SMTP id v28so11705551edw.12 for ; Mon, 24 Feb 2020 04:47:50 -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=o+fzU7ScSNWmDD/rvzUXByxiLzP57T4wLp+6lufEb+8ZiuTh8ILgMWwoGyhZVuGVCX LLTsy2iOQejlTqjxxY9JboCdbgpomxXIEybJyt+uS45oFgpmk6nMrleMOXUj+8C9diz3 cyHq8XfXPXqXcbrvsFNktPyofiQ59Ni/eEvsNJDkMkSbtVHywBhu/ZXaK+YQKRRqZbJ3 MzZQeGU9q4RiJYHLTYIH5OUOlIk6YRPS+5qjkJ/4Xblh1sUvhQe/8IN/AXXa7mYvC0de VGxZxGRkiTR2GgAb2SZ6Agcigk8YSIuGUhimHwSOZFclxSCQut3XAwmXt5kEoerIZY7q XCCA== X-Gm-Message-State: APjAAAWuFT8w+ijd9cT7hI8d64masSgRcXR34DaZnNVnckOhibr03wZ+ fLf9/AYFfslJ96fti8J+r8U= 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 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-Disposition: inline In-Reply-To: <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200224_044751_587331_4B4592B2 X-CRM114-Status: GOOD ( 19.30 ) 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 , Geert Uytterhoeven , "Michael S. Tsirkin" , David Airlie , Benjamin Herrenschmidt , Jason Wang , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev@vger.kernel.org, Paul Mackerras , linux-arch@vger.kernel.org, Dave Jiang , Yoshinori Sato , Michael Ellerman , Helge Deller , linux-sh@vger.kernel.org, Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , linux-snps-arc@lists.infradead.org, Nick Kossifidis , Allen Hubbe , Arnd Bergmann , linux-alpha@vger.kernel.org, Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , linux-parisc@vger.kernel.org, Vineet Gupta , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain , Daniel Vetter , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , linux-media@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S. Miller" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org T24gVGh1LCBGZWIgMjAsIDIwMjAgYXQgMTA6NDg6MzNBTSArMDEwMCwgSmlyaSBTbGFieSB3cm90 ZToKPiBPbiAxOS4gMDIuIDIwLCAxODo1MCwgS3J6eXN6dG9mIEtvemxvd3NraSB3cm90ZToKPiA+ IFRoZSBpb3JlYWRYKCkgaGVscGVycyBoYXZlIGluY29uc2lzdGVudCBpbnRlcmZhY2UuICBPbiBz b21lIGFyY2hpdGVjdHVyZXMKPiA+IHZvaWQgKl9faW9tZW0gYWRkcmVzcyBhcmd1bWVudCBpcyBh IHBvaW50ZXIgdG8gY29uc3QsIG9uIHNvbWUgbm90Lgo+ID4gCj4gPiBJbXBsZW1lbnRhdGlv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FkLm9yZy9tYWlsbWFuL2xp c3RpbmZvL2xpbnV4LXNucHMtYXJjCg== From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Kozlowski Date: Mon, 24 Feb 2020 12:47:44 +0000 Subject: Re: [RESEND PATCH v2 9/9] ath5k: Constify ioreadX() iomem argument (as in generic implementation) Message-Id: <20200224124744.GA1949@pi3> List-Id: References: <20200219175007.13627-1-krzk@kernel.org> <20200219175007.13627-10-krzk@kernel.org> <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> In-Reply-To: <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Jiri Slaby Cc: Rich Felker , Geert Uytterhoeven , "Michael S. Tsirkin" , David Airlie , Jason Wang , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev@vger.kernel.org, Paul Mackerras , linux-arch@vger.kernel.org, Dave Jiang , Yoshinori Sato , Michael Ellerman , Helge Deller , linux-sh@vger.kernel.org, Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , linux-snps-arc@lists.infradead.org, Nick Kossifidis , Allen Hubbe , Arnd Bergmann , linux-alpha@vger.kernel.org, Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , linux-parisc@vger.kernel.org, Vineet Gupta , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , linux-media@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S. Miller" 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 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.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 BA4A7C35671 for ; Mon, 24 Feb 2020 12:50:39 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 233A12072D for ; Mon, 24 Feb 2020 12:50:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 233A12072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48R23c1Ph0zDqWb for ; Mon, 24 Feb 2020 23:50:36 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.208.65; helo=mail-ed1-f65.google.com; envelope-from=k.kozlowski.k@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48R20d55S1zDqWZ for ; Mon, 24 Feb 2020 23:47:52 +1100 (AEDT) Received: by mail-ed1-f65.google.com with SMTP id r18so11763574edl.1 for ; Mon, 24 Feb 2020 04:47:52 -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=N24RVWfl6A/3T78yCiiBzQHESXgpjDadr00KZxWd71MqOMm+M5rzxrFNJAuITKEh0u TF4ION2dGANSN/2G/XgXvyYKVIn8IwTSxwFSMKvBc2zDvctw2L7COndBQVDiIwaPQXgy krypz5uBopFEcSGTX7EdHcMT+wkrI8YVQmfepk4zFMaqjnSmxPE5wxM/lraP3T/bvAny zbo30xy4JjhuNUg4ep8RjQzynCjV/nK936ewfm41KRh9cTniLUCY+qtLS5JpQn8w7p3g VOCV8dlB4PD0Aery1a6op52H7ycykjdtcxsZIlyONhaP2Da4DeDn6Pgym0IVGamnb+DH TT0g== X-Gm-Message-State: APjAAAVz914f5SyPlsmllMkAGuLP1p6JauMWfnQacRqjz4qWYoBFBX+C G+tzyQ/5X0goDPLyRAJPYC4= 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 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: quoted-printable In-Reply-To: <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Geert Uytterhoeven , "Michael S. Tsirkin" , David Airlie , Jason Wang , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev@vger.kernel.org, Paul Mackerras , linux-arch@vger.kernel.org, Dave Jiang , Yoshinori Sato , Helge Deller , linux-sh@vger.kernel.org, Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , linux-snps-arc@lists.infradead.org, Nick Kossifidis , Allen Hubbe , Arnd Bergmann , linux-alpha@vger.kernel.org, Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , linux-parisc@vger.kernel.org, Vineet Gupta , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain , Daniel Vetter , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , linux-media@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 architectur= es > > void *__iomem address argument is a pointer to const, on some not. > >=20 > > 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. > >=20 > > Signed-off-by: Krzysztof Kozlowski > > Acked-by: Kalle Valo > > --- > > drivers/net/wireless/ath/ath5k/ahb.c | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > >=20 > > diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireles= s/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) > > =20 > > if (bcfg->devid >=3D AR5K_SREV_AR2315_R6) { > > /* Enable WMAC AHB arbitration */ > > - reg =3D ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_CTL); > > + reg =3D ioread32((const void __iomem *) AR5K_AR2315_AHB_ARB_CTL); >=20 > 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 =E2=80=98ath_ahb_probe=E2= =80=99: drivers/net/wireless/ath/ath5k/ahb.c:141:18: warning: passing argument 1 of= =E2=80=98ioread32=E2=80=99 makes pointer from integer without a cast [-Win= t-conversion] reg =3D ioread32(AR5K_AR2315_AHB_ARB_CTL); Best regards, Krzysztof 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.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 8611AC35671 for ; Mon, 24 Feb 2020 12:47:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 631132072D for ; Mon, 24 Feb 2020 12:47:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 631132072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC8886E45F; Mon, 24 Feb 2020 12:47:51 +0000 (UTC) Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 863856E45F; Mon, 24 Feb 2020 12:47:50 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id dc19so11719515edb.10; Mon, 24 Feb 2020 04:47:50 -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=tggnjTrjHiImxe2MkX+7io1dJy9jIh4exGDgMXpGPV98LuoIrxImQvP+h1sD4xSkIi bi9d9NGj4TgRAqGeJ+zzKsG1rNJN5yg428QTMCyf2iifCtg8ePRpRjqmx8WE2ZFMsAxN 9mUTlVXiSzVgN3eQHhP6ELbZHB5KR40cGwz/BmlAKPHyYj2kWW/LcxgOP4uveJ8GYuW7 jTq6Or70045ZNK18Mt2zYouJg2JK3FZkMT4WBLpdjGmjoZQyyKk68+8gTkxRop1UnsCQ EwaAmoEjnHdUXl7G/bwD4Xa5fvaMvyZEsgsSgdGYLGP1AsNEjErWsyjr+Kytu7SzEP1G r6pQ== X-Gm-Message-State: APjAAAWaam2V0isRXf5yE5iAkQX7QfXqGYJQtDBN1Jj0yGiIxXYgFkDx Hvj2+i5LjM6DSTtUi1JLrO8= 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 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-Disposition: inline In-Reply-To: <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Geert Uytterhoeven , "Michael S. Tsirkin" , David Airlie , Jason Wang , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev@vger.kernel.org, Paul Mackerras , linux-arch@vger.kernel.org, Dave Jiang , Yoshinori Sato , Michael Ellerman , Helge Deller , linux-sh@vger.kernel.org, Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , linux-snps-arc@lists.infradead.org, Nick Kossifidis , Allen Hubbe , Arnd Bergmann , linux-alpha@vger.kernel.org, Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , linux-parisc@vger.kernel.org, Vineet Gupta , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , linux-media@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S. Miller" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" T24gVGh1LCBGZWIgMjAsIDIwMjAgYXQgMTA6NDg6MzNBTSArMDEwMCwg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