Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757856AbcCRRtK (ORCPT ); Fri, 18 Mar 2016 13:49:10 -0400 Received: from web1.dommelhosting.nl ([88.159.17.71]:60156 "EHLO web1.dommelhosting.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757650AbcCRRtH convert rfc822-to-8bit (ORCPT ); Fri, 18 Mar 2016 13:49:07 -0400 X-Footer: dmFubWllcmxvLmNvbQ== To: "Geert Uytterhoeven" , "Sudip Mukherjee" Cc: "Peter Korsgaard" , "Greg Kroah-Hartman" , "Jiri Slaby" , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org From: "Maarten Brock" Subject: Re: [PATCH] serial-uartlite: fix build warning X-Mailer: Kerio Connect 8.5.0 WebMail Mini Message-ID: <20160318184856.c289c591@kerio.vanmierlo.com> Date: Fri, 18 Mar 2016 18:48:56 +0100 X-User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1786 Lines: 40 ----- 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 > 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 > > Acked-by: Geert Uytterhoeven > > 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