Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934638AbcCJBgB (ORCPT ); Wed, 9 Mar 2016 20:36:01 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:65417 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586AbcCJBfx (ORCPT ); Wed, 9 Mar 2016 20:35:53 -0500 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Arnd Bergmann , Peter Korsgaard , Jiri Slaby , Maarten Brock , Rich Felker , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] serial-uartlite: un-constify uartlite_be/uartlite_le Date: Thu, 10 Mar 2016 02:34:59 +0100 Message-Id: <1457573729-2802736-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:/mpJnGUp5TYUzGoWebGXy0uafJ1S+ECYXCURmnH2s+WeGo4Vpc9 oX7lNWVzCs79GDzAS9SayTo1HSv32tO/nHuiqvghPPVxgB3twjlbpj28MvmkjerwXN3I8dt 4qO265cnqr2aGvLSvc/B+nC3geJy+sSBo1n5QrjKwoRZF2j3tpg8Xenla0M13rWNNDG2eWZ eBzfITM+I79mTO2Lnll1Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:gl9QxA0q9DA=:xVq4P2cK8IF0van3iGHyhU 5kx4yHRxzSENlQU8pz+bihr5yv+Q6gZaAgcJsZ53D17mxfTBPONF1sBpwGd6rXsRNwtuKEmqt Nor9qUoJpZw5+ftMga9hCkPNPVoeRxaxU/MuRqLiapVYzD+r4qV4o8sSqlgzjDenv2RhobKvV Wq5XFqCEAzUiDiKAm+ej5DIzRAs+Aj6PPzxkr3oromTwHRw4Zlboyn54FoKO7OLgnr0RoHGVd aDDcjn+FgJnkaRR6pApYVuO8KRsrY3InrMruh6BKQvVXpXFdbqb4aM03AOGaVSYUh/iEk1Qy3 fNwCZckfeQl5+vae2G2ltTlMP8ux9wVrrBy+DDcjKCR8WP+k89PUQFfAWjWZ8IqpZwNk7yj6b Bve0eL5eKHJPwNH5ZRrzb7WNyGgKtfPTrAi+2VB5AxC7JSimPFcWVL2gY2RUqrdyo0zLZEmB2 cyclbvyM/dwLtA2QBs3O3FQcZ1Q8PpQCsGd5XBdd6VLHLnlAhoqk00o7rkc5Ft9dW8KRKm3re MohW39L0WuYQ6yopx//MTChKWozo5Mndp1rMYANGp4WmkyOoQtMYfSDUF5k5NbMz5jWolO3EF BLbMonXINwuMaWsuU9ydzyqylxSeg51mw/4o0lwoJWA8K1j0Z+pP5hHuyHiblMUU8SUbG1g9L H+vKPwjUKwj8mpUqbfSOT7DuruaPOyWQh7Y+uhGbKpTCB/2cyet/ukV9XMz5EQNOyKRo= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1772 Lines: 46 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