From: Geert Uytterhoeven <geert@linux-m68k.org> To: Krzysztof Kozlowski <krzk@kernel.org> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>, Rich Felker <dalias@libc.org>, Linux-sh list <linux-sh@vger.kernel.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de> Subject: Re: [PATCH] sh: clk: Fix discarding const qualifier warning Date: Tue, 07 Jan 2020 13:00:28 +0000 [thread overview] Message-ID: <CAMuHMdULcBE1inRzTRFJeRDToT1wW+nrMEfiUs7DxMLR0tqb3w@mail.gmail.com> (raw) In-Reply-To: <1578399963-2229-1-git-send-email-krzk@kernel.org> Hi Krzysztof, On Tue, Jan 7, 2020 at 1:26 PM Krzysztof Kozlowski <krzk@kernel.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@kernel.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@linux-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
WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org> To: Krzysztof Kozlowski <krzk@kernel.org> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>, Rich Felker <dalias@libc.org>, Linux-sh list <linux-sh@vger.kernel.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de> Subject: Re: [PATCH] sh: clk: Fix discarding const qualifier warning Date: Tue, 7 Jan 2020 14:00:28 +0100 [thread overview] Message-ID: <CAMuHMdULcBE1inRzTRFJeRDToT1wW+nrMEfiUs7DxMLR0tqb3w@mail.gmail.com> (raw) In-Reply-To: <1578399963-2229-1-git-send-email-krzk@kernel.org> Hi Krzysztof, On Tue, Jan 7, 2020 at 1:26 PM Krzysztof Kozlowski <krzk@kernel.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@kernel.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@linux-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
next prev parent reply other threads:[~2020-01-07 13:00 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-01-07 12:26 [PATCH] sh: clk: Fix discarding const qualifier warning Krzysztof Kozlowski 2020-01-07 12:26 ` Krzysztof Kozlowski 2020-01-07 13:00 ` Geert Uytterhoeven [this message] 2020-01-07 13:00 ` Geert Uytterhoeven 2020-01-07 13:05 ` Krzysztof Kozlowski 2020-01-07 13:05 ` Krzysztof Kozlowski 2020-01-07 13:32 ` Krzysztof Kozlowski 2020-01-07 13:32 ` Krzysztof Kozlowski 2020-01-07 13:54 ` Arnd Bergmann 2020-01-07 13:54 ` Arnd Bergmann 2020-01-07 14:04 ` Krzysztof Kozlowski 2020-01-07 14:04 ` Krzysztof Kozlowski
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=CAMuHMdULcBE1inRzTRFJeRDToT1wW+nrMEfiUs7DxMLR0tqb3w@mail.gmail.com \ --to=geert@linux-m68k.org \ --cc=arnd@arndb.de \ --cc=dalias@libc.org \ --cc=krzk@kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-sh@vger.kernel.org \ --cc=ysato@users.sourceforge.jp \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.