Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360828 > unrolled thread

Re: [PATCH] serial-uartlite: fix build warning

Started by"Maarten Brock" <m.brock@vanmierlo.com>
First post2016-03-18 18:50 +0100
Last post2016-03-18 20:30 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  Re: [PATCH] serial-uartlite: fix build warning "Maarten Brock" <m.brock@vanmierlo.com> - 2016-03-18 18:50 +0100
    Re: [PATCH] serial-uartlite: fix build warning Peter Hurley <peter@hurleysoftware.com> - 2016-03-18 20:20 +0100
      Re: [PATCH] serial-uartlite: fix build warning Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-18 21:40 +0100
    Re: [PATCH] serial-uartlite: fix build warning Geert Uytterhoeven <geert@linux-m68k.org> - 2016-03-18 20:30 +0100

#1360828 — Re: [PATCH] serial-uartlite: fix build warning

From"Maarten Brock" <m.brock@vanmierlo.com>
Date2016-03-18 18:50 +0100
SubjectRe: [PATCH] serial-uartlite: fix build warning
Message-ID<re6H8-3uY-7@gated-at.bofh.it>
----- 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

[toc] | [next] | [standalone]


#1360878

FromPeter Hurley <peter@hurleysoftware.com>
Date2016-03-18 20:20 +0100
Message-ID<re86e-5Tk-9@gated-at.bofh.it>
In reply to#1360828
On 03/18/2016 10:48 AM, Maarten Brock wrote:
> ----- 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.

I agree; better to revert commit 2905697a82ea and let Maarten re-submit
a patch that doesn't generate build warnings.


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

memcpy

Regards,
Peter Hurley
 

[toc] | [prev] | [next] | [standalone]


#1360913

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-03-18 21:40 +0100
Message-ID<re9lE-7Q8-17@gated-at.bofh.it>
In reply to#1360878
On Fri, Mar 18, 2016 at 12:19:40PM -0700, Peter Hurley wrote:
> On 03/18/2016 10:48 AM, Maarten Brock wrote:
> > ----- 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.
> 
> I agree; better to revert commit 2905697a82ea and let Maarten re-submit
> a patch that doesn't generate build warnings.

I'll fix this up after 4.6-rc1 is out, thanks.

greg k-h

[toc] | [prev] | [next] | [standalone]


#1360883

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-03-18 20:30 +0100
Message-ID<re8fV-661-21@gated-at.bofh.it>
In reply to#1360828
On Fri, Mar 18, 2016 at 6:48 PM, Maarten Brock <m.brock@vanmierlo.com> wrote:
> ----- 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>
>
> 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.

You're right, I was a bit too hasty adding my Acked-by.

Hereby I would like to withdraw my Acked-by.

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web