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]
Date:   Tue, 7 Jan 2020 14:00:28 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Krzysztof Kozlowski <krzk@...nel.org>
Cc:     Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>,
        Linux-sh list <linux-sh@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] sh: clk: Fix discarding const qualifier warning

Hi Krzysztof,

On Tue, Jan 7, 2020 at 1:26 PM Krzysztof Kozlowski <krzk@...nel.org> wrote:
> ioreadX() accepts pointer to non-const memory.  This fixes warnings
> like:
>
>     drivers/sh/clk/cpg.c: In function ‘r8’:
>     drivers/sh/clk/cpg.c:41:17: warning: passing argument 1 of ‘ioread8’
>         discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>

Thanks for your patch!

> --- a/drivers/sh/clk/cpg.c
> +++ b/drivers/sh/clk/cpg.c
> @@ -36,17 +36,17 @@ static void sh_clk_write(int value, struct clk *clk)
>                 iowrite32(value, clk->mapped_reg);
>  }
>
> -static unsigned int r8(const void __iomem *addr)
> +static unsigned int r8(void __iomem *addr)
>  {
>         return ioread8(addr);
>  }

Isn't the real issue that some implementations of ioreadX() take const,
while others don't?

Even the generic ones disagree:

    include/asm-generic/io.h:static inline u8 ioread8(const volatile
void __iomem *addr)
    include/asm-generic/iomap.h:extern unsigned int ioread8(void __iomem *);

IMHO they all should take "const volatile void __iomem *".

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