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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message -----
From: Geert Uytterhoeven [mailto:geert@xxxxxxxxxxxxxx]
To: Sudip Mukherjee [mailto:sudipm.mukherjee@xxxxxxxxx]
Cc: Peter Korsgaard [mailto:jacmet@xxxxxxxxxx], Greg Kroah-Hartman [mailto:gregkh@xxxxxxxxxxxxxxxxxxx], Jiri Slaby [mailto:jslaby@xxxxxxxx], linux-kernel@xxxxxxxxxxxxxxx [mailto:linux-kernel@xxxxxxxxxxxxxxx], linux-serial@xxxxxxxxxxxxxxx [mailto:linux-serial@xxxxxxxxxxxxxxx]
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@xxxxxxxxx> 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@xxxxxxxxxxxxxxx>
> 
> Acked-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux