linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial-uartlite: fix build warning
@ 2016-03-10 13:14 Sudip Mukherjee
  2016-03-18 12:48 ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Sudip Mukherjee @ 2016-03-10 13:14 UTC (permalink / raw)
  To: Peter Korsgaard, Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-kernel, linux-serial, Sudip Mukherjee

We were getting build warnings about:
drivers/tty/serial/uartlite.c: In function ‘ulite_request_port’:
drivers/tty/serial/uartlite.c:348:21: warning: assignment discards
        'const' qualifier from pointer target type
port->private_data = &uartlite_be;
                     ^
drivers/tty/serial/uartlite.c:354:22: warning: assignment discards
        'const' qualifier from pointer target type
port->private_data = &uartlite_le;
                      ^

Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le")
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---

next-20160310 build log at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/114988022

 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 c9fdfc8..1474c57 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,
 };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* Re: [PATCH] serial-uartlite: fix build warning
@ 2016-03-10 15:20 Maarten Brock
  0 siblings, 0 replies; 7+ messages in thread
From: Maarten Brock @ 2016-03-10 15:20 UTC (permalink / raw)
  To: Peter Korsgaard, Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-kernel, linux-serial, Sudip Mukherjee

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 

> We were getting build warnings about:
> drivers/tty/serial/uartlite.c: In function ‘ulite_request_port’:
> drivers/tty/serial/uartlite.c:348:21: warning: assignment discards
>         'const' qualifier from pointer target type
> port->private_data = &uartlite_be;
>                      ^
> drivers/tty/serial/uartlite.c:354:22: warning: assignment discards
>         'const' qualifier from pointer target type
> port->private_data = &uartlite_le;
>                       ^
> 
> Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le")
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> ---
> 
> next-20160310 build log at:
> https://travis-ci.org/sudipm-mukherjee/parport/jobs/114988022
> 
>  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 c9fdfc8..1474c57 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,
>  };
> -- 
> 1.9.1

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [PATCH] serial-uartlite: fix build warning
@ 2016-03-18 17:48 Maarten Brock
  2016-03-18 19:19 ` Peter Hurley
  2016-03-18 19:20 ` Geert Uytterhoeven
  0 siblings, 2 replies; 7+ messages in thread
From: Maarten Brock @ 2016-03-18 17:48 UTC (permalink / raw)
  To: Geert Uytterhoeven, Sudip Mukherjee
  Cc: Peter Korsgaard, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
	linux-serial

----- Original Message -----
From: Geert Uytterhoeven [mailto:geert@linux-m68k.org]
To: Sudip Mukherjee [mailto:sudipm.mukherjee@gmail.com]
Cc: Peter Korsgaard [mailto:jacmet@sunsite.dk], Greg Kroah-Hartman [mailto:gregkh@linuxfoundation.org], Jiri Slaby [mailto:jslaby@suse.com], linux-kernel@vger.kernel.org [mailto:linux-kernel@vger.kernel.org], linux-serial@vger.kernel.org [mailto:linux-serial@vger.kernel.org]
Sent: Fri, 18 Mar 2016 13:48:06 +0100
Subject: Re: [PATCH] serial-uartlite: fix build warning


> On Thu, Mar 10, 2016 at 2:14 PM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > We were getting build warnings about:
> > drivers/tty/serial/uartlite.c: In function ‘ulite_request_port’:
> > drivers/tty/serial/uartlite.c:348:21: warning: assignment discards
> >         'const' qualifier from pointer target type
> > port->private_data = &uartlite_be;
> >                      ^
> > drivers/tty/serial/uartlite.c:354:22: warning: assignment discards
> >         'const' qualifier from pointer target type
> > port->private_data = &uartlite_le;
> >                       ^
> >
> > Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le")
> > Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> 
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> 
> Gr{oetje,eeting}s,
> 
>                         Geert

Reverting is not the same as fixing.

Rant:
It is a stupid warning IMHO, but being a compiler writer myself (SDCC) I
understand how it can arise. If you assign some const pointer to a void
pointer without an explicit cast gcc does not complain about the complete
loss of type, but it does warn about losing constness. In general I'd say:
make up your mind; either warn about both or don't warn about either.

Maarten

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

end of thread, other threads:[~2016-03-18 20:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 13:14 [PATCH] serial-uartlite: fix build warning Sudip Mukherjee
2016-03-18 12:48 ` Geert Uytterhoeven
  -- strict thread matches above, loose matches on Subject: below --
2016-03-10 15:20 Maarten Brock
2016-03-18 17:48 Maarten Brock
2016-03-18 19:19 ` Peter Hurley
2016-03-18 20:32   ` Greg Kroah-Hartman
2016-03-18 19:20 ` Geert Uytterhoeven

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