Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754653AbcCJJ3M (ORCPT ); Thu, 10 Mar 2016 04:29:12 -0500 Received: from web1.dommelhosting.nl ([88.159.17.71]:56306 "EHLO web1.dommelhosting.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753988AbcCJJ3E convert rfc822-to-8bit (ORCPT ); Thu, 10 Mar 2016 04:29:04 -0500 X-Greylist: delayed 1251 seconds by postgrey-1.27 at vger.kernel.org; Thu, 10 Mar 2016 04:29:04 EST X-Footer: dmFubWllcmxvLmNvbQ== To: "Arnd Bergmann" , "Greg Kroah-Hartman" Cc: "Arnd Bergmann" , "Peter Korsgaard" , "Jiri Slaby" , "Rich Felker" , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org From: "Maarten Brock" Subject: Re: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le X-Mailer: Kerio Connect 8.5.0 WebMail Mini Message-ID: <20160310100801.37d49aba@kerio.vanmierlo.com> Date: Thu, 10 Mar 2016 10:08:01 +0100 X-User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2022 Lines: 56 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 > The patch to make uartlite_be/uartlite_le const was well-intended but > caused a new build warning: > > tty/serial/uartlite.c: In function 'ulite_request_port': > tty/serial/uartlite.c:348:21: error: assignment discards 'const' qualifier > from pointer target type [-Werror=discarded-qualifiers] > tty/serial/uartlite.c:354:22: error: assignment discards 'const' qualifier > from pointer target type [-Werror=discarded-qualifiers] > > It would be nice to allow passing const pointers through > port->private_data, but that would be way more work, so this > reverts part of the original commit for now. > > A possible alternative might be to pass a structure in the private_data > that contains a const pointer to the operations, which introduces a little > extra overhead, or we could just add a cast to a non-const pointer, I'll > leave that to the maintainer. > > Signed-off-by: Arnd Bergmann > Fixes: 2905697a82ea ("serial-uartlite: Constify uartlite_be/uartlite_le") > --- > 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 c9fdfc8bf47f..1474c5755140 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, > }; > -- > 2.7.0 > >