lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXTxTABOoVgC6fVR44dxUZZEbZV=ewSk9vKFY=U5u+fcw@mail.gmail.com>
Date:   Wed, 24 Nov 2021 08:51:24 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Finn Thain <fthain@...ux-m68k.org>
Cc:     Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
        Michael Schmitz <schmitzmic@...il.com>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        Jens Axboe <axboe@...nel.dk>, linux-ide@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] pata_falcon: Add missing __iomem annotations

Hi Finn,

On Wed, Nov 24, 2021 at 8:36 AM Finn Thain <fthain@...ux-m68k.org> wrote:
> The zero day bot reported some sparse complaints in pata_falcon.c. E.g.
>
> drivers/ata/pata_falcon.c:58:41: warning: cast removes address space '__iomem' of expression
> drivers/ata/pata_falcon.c:58:41: warning: incorrect type in argument 1 (different address spaces)
> drivers/ata/pata_falcon.c:58:41:    expected unsigned short volatile [noderef] [usertype] __iomem *port
> drivers/ata/pata_falcon.c:58:41:    got unsigned short [usertype] *
>
> The same thing shows up in 8 places, all told. Avoid this by use of
> __iomem type casts.
>
> Cc: Michael Schmitz <schmitzmic@...il.com>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
> Cc: Jens Axboe <axboe@...nel.dk>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Finn Thain <fthain@...ux-m68k.org>

Thanks for your patch!

> --- 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 *.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ