lkml.org 
[lkml]   [2016]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] serial-uartlite: fix build warning
From
Date
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


\
 
 \ /
  Last update: 2016-03-18 21:01    [W:0.052 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site