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=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 98BADC35671 for ; Mon, 24 Feb 2020 12:58:13 +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 521162080D for ; Mon, 24 Feb 2020 12:58:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 521162080D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.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 48R2DL46QYzDqNd for ; Mon, 24 Feb 2020 23:58:10 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.210.67; helo=mail-ot1-f67.google.com; envelope-from=geert.uytterhoeven@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) (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 48R27s3fykzDqF5 for ; Mon, 24 Feb 2020 23:54:14 +1100 (AEDT) Received: by mail-ot1-f67.google.com with SMTP id z9so8564670oth.5 for ; Mon, 24 Feb 2020 04:54:14 -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:content-transfer-encoding; bh=KuIMkn3CNjUmXT9na5O6u952ZSxUT8pEly8T96UQHaU=; b=fN7ViY1HadQ0Yu6xBK5D5KiDXYh0M2gO7yw34uZixelEVKGooRrwPHd4NoT3jmsZeB yFAzxQvhkin7bhk+gzbgG2vJbtHtCfyX1RXCz1/W1GzkcN68uqzc6AmK/SG/peiZH3gi 5LOHH86HSDPg+OLQckAWIdY4glw5uSW84/RnvhhBJA8GLktXhwvPsfKvSds3thdvy+LA gs/8cY4m6oecBQRIxyGXNyhpjLzlSmV+B28oaNz/PKJPx/Ez/AXTpa+QgdpYRsQCthLv 0MzKfMXvvf8QjDpeSXAk+aN3LElTLnAvvOtU3XTLgBBwk5JVbeYu5z/Z+9iZkKHWF7GQ sFHw== X-Gm-Message-State: APjAAAWoOuUfaYsj6w2VQZEFEAx6YH7LlAWZclfnX1Zkuv5J587iijz6 AA/OpFq2u9hUcRiNOyrreKfDySpp4hZNMW8wVs4= X-Google-Smtp-Source: APXvYqwtZk2+zO66egcnUYHRtozVqcTMGUrrNpS9RZJQahGOv8qXCcCp9UcRypG9zsmrMsbFU1zCpBady1p1pO44v4k= X-Received: by 2002:a9d:7984:: with SMTP id h4mr40460889otm.297.1582548851139; Mon, 24 Feb 2020 04:54:11 -0800 (PST) MIME-Version: 1.0 References: <20200219175007.13627-1-krzk@kernel.org> <20200219175007.13627-10-krzk@kernel.org> <518a9023-f802-17b3-fca5-582400bc34ae@gmail.com> <20200224124744.GA1949@pi3> In-Reply-To: <20200224124744.GA1949@pi3> From: Geert Uytterhoeven Date: Mon, 24 Feb 2020 13:54:00 +0100 Message-ID: Subject: Re: [RESEND PATCH v2 9/9] ath5k: Constify ioreadX() iomem argument (as in generic implementation) To: Krzysztof Kozlowski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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" Hi Krzysztof, On Mon, Feb 24, 2020 at 1:47 PM Krzysztof Kozlowski wrote= : > 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 architect= ures > > > void *__iomem address argument is a pointer to const, on some not. > > > > > > Implementations of ioreadX() do not modify the memory under the addre= ss > > > 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/wirel= ess/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 >=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_A= RB_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_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 [-W= int-conversion] > reg =3D ioread32(AR5K_AR2315_AHB_ARB_CTL); That's an argument for keeping the cast to "void __iomem *", not for adding the "const", right? Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= .org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds