Re: [PATCH] pata_falcon: Add missing __iomem annotations

From: Geert Uytterhoeven
Date: Thu Nov 25 2021 - 02:35:46 EST


Hi Michael,

On Wed, Nov 24, 2021 at 9:50 PM Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:
> On Wed, Nov 24, 2021 at 8:51 PM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> > > --- a/drivers/ata/pata_falcon.c
> > > +++ b/drivers/ata/pata_falcon.c
> > > @@ -55,14 +55,14 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
> > > /* Transfer multiple of 2 bytes */
> > > if (rw == READ) {
> > > if (swap)
> > > - raw_insw_swapw((u16 *)data_addr, (u16 *)buf, words);
> > > + raw_insw_swapw((u16 __iomem *)data_addr, (u16 *)buf, words);
> > > else
> > > - raw_insw((u16 *)data_addr, (u16 *)buf, words);
> > > + raw_insw((u16 __iomem *)data_addr, (u16 *)buf, words);
> > > } else {
> > > if (swap)
> > > - raw_outsw_swapw((u16 *)data_addr, (u16 *)buf, words);
> > > + raw_outsw_swapw((u16 __iomem *)data_addr, (u16 *)buf, words);
> > > else
> > > - raw_outsw((u16 *)data_addr, (u16 *)buf, words);
> > > + raw_outsw((u16 __iomem *)data_addr, (u16 *)buf, words);
> >
> > Can't you just drop the casts? data_addr is an __iomem void *.
>
> It's not u16 though, and the raw_ IO functions require that. But we
> could cast data_addr as __iomem u16 * (compile tested).

The raw_ IO functions do not require that: you can pass a void *
to a function that expects a different pointer type.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds