public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel•org>
To: Geert Uytterhoeven <geert@linux-m68k•org>
Cc: Rich Felker <dalias@libc•org>, Jiri Slaby <jirislaby@gmail•com>,
	Geert Uytterhoeven <geert+renesas@glider•be>,
	"Michael S. Tsirkin" <mst@redhat•com>,
	David Airlie <airlied@linux•ie>, Jason Wang <jasowang@redhat•com>,
	DRI Development <dri-devel@lists•freedesktop.org>,
	virtualization@lists•linux-foundation.org,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership•com>,
	netdev <netdev@vger•kernel.org>,
	Paul Mackerras <paulus@samba•org>,
	Linux-Arch <linux-arch@vger•kernel.org>,
	Dave Jiang <dave.jiang@intel•com>,
	Yoshinori Sato <ysato@users•sourceforge.jp>,
	Helge Deller <deller@gmx•de>,
	Linux-sh list <linux-sh@vger•kernel.org>,
	Alexey Brodkin <abrodkin@synopsys•com>,
	Ben Skeggs <bskeggs@redhat•com>,
	nouveau@lists•freedesktop.org, Dave Airlie <airlied@redhat•com>,
	Matt Turner <mattst88@gmail•com>,
	arcml <linux-snps-arc@lists•infradead.org>,
	Nick Kossifidis <mickflemm@gmail•com>,
	Allen Hubbe <allenbh@gmail•com>, Arnd Bergmann <arnd@arndb•de>,
	alpha <linux-alpha@vger•kernel.org>,
	Ivan Kokshaysky <ink@jurassic•park.msu.ru>,
	Thomas Gleixner <tglx@linutronix•de>,
	Mauro Carvalho Chehab <mchehab@kernel•org>,
	Kalle Valo <kvalo@codeaurora•org>,
	Richard Henderson <rth@twiddle•net>,
	Parisc List <linux-parisc@vger•kernel.org>,
	Vineet Gupta <vgupta@synopsys•com>,
	linux-wireless <linux-wireless@vger•kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Luis Chamberlain <mcgrof@kernel•org>,
	Daniel Vetter <daniel@ffwll•ch>, Jon Mason <jdmason@kudzu•us>,
	linux-ntb@googlegroups•com,
	Andrew Morton <akpm@linux-foundation•org>,
	Linux Media Mailing List <linux-media@vger•kernel.org>,
	linuxppc-dev <linuxppc-dev@lists•ozlabs.org>,
	"David S. Miller" <davem@davemloft•net>
Subject: Re: [RESEND PATCH v2 9/9] ath5k: Constify ioreadX() iomem argument (as in generic implementation)
Date: Mon, 24 Feb 2020 15:44:13 +0100	[thread overview]
Message-ID: <20200224144413.GA2054@pi3> (raw)
In-Reply-To: <CAMuHMdVev0PLF=8bD3nHrhcU9UgM-DAgdQpXi09PgvAxdbt24A@mail.gmail.com>

On Mon, Feb 24, 2020 at 01:54:00PM +0100, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Mon, Feb 24, 2020 at 1:47 PM Krzysztof Kozlowski <krzk@kernel•org> 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 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 <krzk@kernel•org>
> > > > Acked-by: Kalle Valo <kvalo@codeaurora•org>
> > > > ---
> > > >  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);
> 
> 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


      parent reply	other threads:[~2020-02-24 14:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 17:49 [RESEND PATCH v2 0/9] iomap: Constify ioreadX() iomem argument Krzysztof Kozlowski
2020-02-19 17:49 ` [RESEND PATCH v2 1/9] iomap: Constify ioreadX() iomem argument (as in generic implementation) Krzysztof Kozlowski
2020-03-12 10:55   ` Michael Ellerman
2020-03-14 11:02   ` Krzysztof Kozlowski
2020-02-19 17:50 ` [RESEND PATCH v2 2/9] rtl818x: " Krzysztof Kozlowski
2020-02-19 17:50 ` [RESEND PATCH v2 3/9] ntb: intel: " Krzysztof Kozlowski
2020-02-19 17:50 ` [RESEND PATCH v2 4/9] virtio: pci: " Krzysztof Kozlowski
2020-02-19 17:50 ` [RESEND PATCH v2 5/9] arc: " Krzysztof Kozlowski
2020-02-19 17:50 ` [RESEND PATCH v2 6/9] drm/mgag200: " Krzysztof Kozlowski
2020-03-12 10:49   ` Thomas Zimmermann
2020-03-14 10:59     ` Krzysztof Kozlowski
2020-03-24  8:39       ` Thomas Zimmermann
2020-02-19 17:50 ` [RESEND PATCH v2 7/9] drm/nouveau: " Krzysztof Kozlowski
2020-02-19 17:50 ` [RESEND PATCH v2 8/9] media: fsl-viu: " Krzysztof Kozlowski
2020-03-12  8:01   ` Hans Verkuil
2020-02-19 17:50 ` [RESEND PATCH v2 9/9] ath5k: " Krzysztof Kozlowski
2020-02-20  9:48   ` Jiri Slaby
2020-02-24 12:47     ` Krzysztof Kozlowski
2020-02-24 12:54       ` Geert Uytterhoeven
2020-02-24 14:00         ` David Laight
2020-02-24 14:44         ` Krzysztof Kozlowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200224144413.GA2054@pi3 \
    --to=krzk@kernel$(echo .)org \
    --cc=James.Bottomley@hansenpartnership$(echo .)com \
    --cc=abrodkin@synopsys$(echo .)com \
    --cc=airlied@linux$(echo .)ie \
    --cc=airlied@redhat$(echo .)com \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=allenbh@gmail$(echo .)com \
    --cc=arnd@arndb$(echo .)de \
    --cc=bskeggs@redhat$(echo .)com \
    --cc=dalias@libc$(echo .)org \
    --cc=daniel@ffwll$(echo .)ch \
    --cc=dave.jiang@intel$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=deller@gmx$(echo .)de \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=geert+renesas@glider$(echo .)be \
    --cc=geert@linux-m68k$(echo .)org \
    --cc=ink@jurassic$(echo .)park.msu.ru \
    --cc=jasowang@redhat$(echo .)com \
    --cc=jdmason@kudzu$(echo .)us \
    --cc=jirislaby@gmail$(echo .)com \
    --cc=kvalo@codeaurora$(echo .)org \
    --cc=linux-alpha@vger$(echo .)kernel.org \
    --cc=linux-arch@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-media@vger$(echo .)kernel.org \
    --cc=linux-ntb@googlegroups$(echo .)com \
    --cc=linux-parisc@vger$(echo .)kernel.org \
    --cc=linux-sh@vger$(echo .)kernel.org \
    --cc=linux-snps-arc@lists$(echo .)infradead.org \
    --cc=linux-wireless@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mattst88@gmail$(echo .)com \
    --cc=mcgrof@kernel$(echo .)org \
    --cc=mchehab@kernel$(echo .)org \
    --cc=mickflemm@gmail$(echo .)com \
    --cc=mst@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nouveau@lists$(echo .)freedesktop.org \
    --cc=paulus@samba$(echo .)org \
    --cc=rth@twiddle$(echo .)net \
    --cc=tglx@linutronix$(echo .)de \
    --cc=vgupta@synopsys$(echo .)com \
    --cc=virtualization@lists$(echo .)linux-foundation.org \
    --cc=ysato@users$(echo .)sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox