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 C6715C11D2F for ; Mon, 24 Feb 2020 14:46:16 +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 1930820714 for ; Mon, 24 Feb 2020 14:46:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1930820714 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 48R4d16NCvzDqWS for ; Tue, 25 Feb 2020 01:46:13 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.208.66; helo=mail-ed1-f66.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-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) (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 48R4Zw3s3fzDqMx for ; Tue, 25 Feb 2020 01:44:22 +1100 (AEDT) Received: by mail-ed1-f66.google.com with SMTP id r18so12183653edl.1 for ; Mon, 24 Feb 2020 06:44:22 -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=9BiQIzqw1g4Lc7fCMo41b2Sms1ZkrHji7czRtN4yRpY=; b=hsdftQS6Lnl9R6n8mXB0GnzAK7/Yt6Nzg5eXgWzzsVOhH0M7uZbbZ6Hdru1T4wUOnf h9H0vd6agDEn6RHNrtSkwonrIwV/m0RUx+/5B8W8vmnTeqHuMB0wsrN8VL9ldYRjL2jC bEFBtdBwYn1AYh5A15F2D1/JDiosew4V7+xcLKD9PS0qaq3puQu/DYibavpafhjfeniq ef7Vf6rd67FLz/GeSqsVpJLMyww1XSNzS8C5QEzgKwMiVyEgfvA+KrCjbDvEJa1WC/mw 6NoKEPNSiPceJd0d54fkh/6HExpu6yV9WhpsJUufFjTOAZwlXYIzs54SRUMLpCX2ySAw TEqw== X-Gm-Message-State: APjAAAX1VOj0Dwyit/PUoSuoiW244n2nZEbruD+6gwr5ZT8CCFyZ5tOd W73OXMkF3rkB2jZuGyFA94g= X-Google-Smtp-Source: APXvYqzwji2Ykgei/T3ukpc15pByx2S09B2SSkaAFB5FVLPyRnARm/VtcP3TWvca57zCxPIFcvsdrw== X-Received: by 2002:a17:906:5604:: with SMTP id f4mr47998768ejq.255.1582555459077; Mon, 24 Feb 2020 06:44:19 -0800 (PST) Received: from pi3 ([194.230.155.125]) by smtp.googlemail.com with ESMTPSA id a10sm961255edt.50.2020.02.24.06.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 06:44:17 -0800 (PST) Date: Mon, 24 Feb 2020 15:44:13 +0100 From: Krzysztof Kozlowski To: Geert Uytterhoeven Subject: Re: [RESEND PATCH v2 9/9] ath5k: Constify ioreadX() iomem argument (as in generic implementation) Message-ID: <20200224144413.GA2054@pi3> References: <20200219175007.13627-1-krzk@kernel.org> <20200219175007.13627-10-krzk@kernel.org> <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> <20200224124744.GA1949@pi3> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: 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 , Jiri Slaby , Geert Uytterhoeven , "Michael S. Tsirkin" , David Airlie , Jason Wang , DRI Development , virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , 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" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Feb 24, 2020 at 01:54:00PM +0100, Geert Uytterhoeven wrote: > Hi Krzysztof, >=20 > On Mon, Feb 24, 2020 at 1:47 PM Krzysztof Kozlowski wro= te: > > 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 archite= ctures > > > > void *__iomem address argument is a pointer to const, on some not. > > > > > > > > Implementations of ioreadX() do not modify the memory under the add= ress > > > > 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/wir= eless/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_devi= ce *pdev) > > > > > > > > if (bcfg->devid >=3D AR5K_SREV_AR2315_R6) { > > > > /* Enable WMAC AHB arbitration */ > > > > - reg =3D ioread32((void __iomem *) AR5K_AR2315_AHB_ARB_C= TL); > > > > + reg =3D 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 =E2=80=98ath_ahb_prob= e=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 [= -Wint-conversion] > > reg =3D ioread32(AR5K_AR2315_AHB_ARB_CTL); >=20 > That's an argument for keeping the cast to "void __iomem *", not for > adding the "const", right? Yes, correct. Maybe I misunderstood the question... The const on the other hand does not have to be in the cast. It is merely for making it consistent with interface. It is not required. I also mentioned it in the cover letter: "PAtches 5-9 are optional cleanup, without actual impact" Feel free to ignore this one if it is not worth the effort. Best regards, Krzysztof