linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le
@ 2016-03-10  9:08 Maarten Brock
  2016-04-19  6:12 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Maarten Brock @ 2016-03-10  9:08 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman
  Cc: Arnd Bergmann, Peter Korsgaard, Jiri Slaby, Rich Felker,
	linux-serial, linux-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le
  2016-03-10  9:08 [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le Maarten Brock
@ 2016-04-19  6:12 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2016-04-19  6:12 UTC (permalink / raw)
  To: Maarten Brock
  Cc: Arnd Bergmann, Peter Korsgaard, Jiri Slaby, Rich Felker,
	linux-serial, linux-kernel

On Thu, Mar 10, 2016 at 10:08:01AM +0100, Maarten Brock wrote:
> I've created a version 2 of this patch immediately which fixes the warning,
> but somehow this stays ignored.
> 
> Please apply my second patch!

Sorry, it was too late, my fault.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le
  2016-04-19  7:51 Maarten Brock
@ 2016-04-19  8:33 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2016-04-19  8:33 UTC (permalink / raw)
  To: Maarten Brock
  Cc: Arnd Bergmann, Peter Korsgaard, Jiri Slaby, Rich Felker,
	linux-serial, linux-kernel

On Tue, Apr 19, 2016 at 09:51:43AM +0200, Maarten Brock wrote:
> ----- Original Message -----
> From: Greg Kroah-Hartman [mailto:gregkh@linuxfoundation.org]
> To: Maarten Brock [mailto:m.brock@vanmierlo.com]
> Cc: Arnd Bergmann [mailto:arnd@arndb.de], Peter Korsgaard [mailto:jacmet@sunsite.dk], Jiri Slaby [mailto:jslaby@suse.com], Rich Felker [mailto:dalias@libc.org], linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
> Sent: Tue, 19 Apr 2016 08:12:36 +0200
> Subject: Re: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le
> 
> 
> > On Thu, Mar 10, 2016 at 10:08:01AM +0100, Maarten Brock wrote:
> > > I've created a version 2 of this patch immediately which fixes the
> > > warning, but somehow this stays ignored.
> > > 
> > > Please apply my second patch!
> > 
> > Sorry, it was too late, my fault.
> > 
> > greg k-h
> 
> Hello Greg,
> 
> Now that the original patch is reverted, can you apply my second version of the
> patch which includes extra casts to suppress the warnings?

Can you please resend it?  I don't see it in my queue :(

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le
@ 2016-04-19  7:51 Maarten Brock
  2016-04-19  8:33 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Maarten Brock @ 2016-04-19  7:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arnd Bergmann, Peter Korsgaard, Jiri Slaby, Rich Felker,
	linux-serial, linux-kernel

----- Original Message -----
From: Greg Kroah-Hartman [mailto:gregkh@linuxfoundation.org]
To: Maarten Brock [mailto:m.brock@vanmierlo.com]
Cc: Arnd Bergmann [mailto:arnd@arndb.de], Peter Korsgaard [mailto:jacmet@sunsite.dk], Jiri Slaby [mailto:jslaby@suse.com], Rich Felker [mailto:dalias@libc.org], linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Sent: Tue, 19 Apr 2016 08:12:36 +0200
Subject: Re: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le


> On Thu, Mar 10, 2016 at 10:08:01AM +0100, Maarten Brock wrote:
> > I've created a version 2 of this patch immediately which fixes the
> > warning, but somehow this stays ignored.
> > 
> > Please apply my second patch!
> 
> Sorry, it was too late, my fault.
> 
> greg k-h

Hello Greg,

Now that the original patch is reverted, can you apply my second version of the
patch which includes extra casts to suppress the warnings?

Maarten

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le
@ 2016-03-10  1:34 Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2016-03-10  1:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arnd Bergmann, Peter Korsgaard, Jiri Slaby, Maarten Brock,
	Rich Felker, linux-serial, linux-kernel

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-19  8:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-10  9:08 [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le Maarten Brock
2016-04-19  6:12 ` 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

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