From: "Maarten Brock" <m.brock@vanmierlo.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Peter Korsgaard <jacmet@sunsite.dk>, Jiri Slaby <jslaby@suse.com>,
Rich Felker <dalias@libc.org>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le
Date: Thu, 10 Mar 2016 10:08:01 +0100 [thread overview]
Message-ID: <20160310100801.37d49aba@kerio.vanmierlo.com> (raw)
I've created a version 2 of this patch immediately which fixes the warning,
but somehow this stays ignored.
Please apply my second patch!
Maarten
> The patch to make uartlite_be/uartlite_le const was well-intended but
> caused a new build warning:
>
> tty/serial/uartlite.c: In function 'ulite_request_port':
> tty/serial/uartlite.c:348:21: error: assignment discards 'const' qualifier
> from pointer target type [-Werror=discarded-qualifiers]
> tty/serial/uartlite.c:354:22: error: assignment discards 'const' qualifier
> from pointer target type [-Werror=discarded-qualifiers]
>
> It would be nice to allow passing const pointers through
> port->private_data, but that would be way more work, so this
> reverts part of the original commit for now.
>
> A possible alternative might be to pass a structure in the private_data
> that contains a const pointer to the operations, which introduces a little
> extra overhead, or we could just add a cast to a non-const pointer, I'll
> leave that to the maintainer.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le")
> ---
> drivers/tty/serial/uartlite.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
> index c9fdfc8bf47f..1474c5755140 100644
> --- a/drivers/tty/serial/uartlite.c
> +++ b/drivers/tty/serial/uartlite.c
> @@ -72,7 +72,7 @@ static void uartlite_outbe32(u32 val, void __iomem *addr)
> iowrite32be(val, addr);
> }
>
> -static const struct uartlite_reg_ops uartlite_be = {
> +static struct uartlite_reg_ops uartlite_be = {
> .in = uartlite_inbe32,
> .out = uartlite_outbe32,
> };
> @@ -87,7 +87,7 @@ static void uartlite_outle32(u32 val, void __iomem *addr)
> iowrite32(val, addr);
> }
>
> -static const struct uartlite_reg_ops uartlite_le = {
> +static struct uartlite_reg_ops uartlite_le = {
> .in = uartlite_inle32,
> .out = uartlite_outle32,
> };
> --
> 2.7.0
>
>
next reply other threads:[~2016-03-10 9:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 9:08 Maarten Brock [this message]
2016-04-19 6:12 ` [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2016-04-19 7:51 Maarten Brock
2016-04-19 8:33 ` Greg Kroah-Hartman
2016-03-10 1:34 Arnd Bergmann
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=20160310100801.37d49aba@kerio.vanmierlo.com \
--to=m.brock@vanmierlo.com \
--cc=arnd@arndb.de \
--cc=dalias@libc.org \
--cc=gregkh@linuxfoundation.org \
--cc=jacmet@sunsite.dk \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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: link
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;
as well as URLs for NNTP newsgroup(s).