From patchwork Sun Apr 17 00:12:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102499 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp621255qge; Sat, 16 Apr 2016 17:13:34 -0700 (PDT) X-Received: by 10.66.140.105 with SMTP id rf9mr39774646pab.117.1460852014278; Sat, 16 Apr 2016 17:13:34 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gj3si6437110pac.243.2016.04.16.17.13.34; Sat, 16 Apr 2016 17:13:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbcDQANd (ORCPT + 2 others); Sat, 16 Apr 2016 20:13:33 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:62480 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbcDQANc (ORCPT ); Sat, 16 Apr 2016 20:13:32 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0MLOoU-1ar2N30Yxm-000ZOh; Sun, 17 Apr 2016 02:13:11 +0200 From: Arnd Bergmann To: Peter Korsgaard , Greg Kroah-Hartman Cc: Arnd Bergmann , Jiri Slaby , Maarten Brock , Rich Felker , Michal Simek , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH, RESEND] serial-uartlite: un-constify uartlite_be/uartlite_le Date: Sun, 17 Apr 2016 02:12:47 +0200 Message-Id: <1460851985-1280235-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:1aOOKisZRUEDS81Ov6bcRF5E5MEl15gis1nQBqukvysiP71QhQt HHht+nYNgeEfivGmHr3638bwv+VgqjN8XqAyDwlkQYylyhVueaDlGfCECg4RtnF/YePTBNr 0rjxnp5sbQG9yXSumWMGj1UrnzCu7eH7sUWy/eGv+PNWNq5oga07hzcfmRG1moHjPsgtClr uz8XOuP08TBGbkvoDa9Sg== X-UI-Out-Filterresults: notjunk:1; V01:K0:prOP5agKDtc=:iLWgurqk7SaD2oIirDgL+m DH92lpWGf64ea5kBJjblyIuwlaMliPuS+V3G3DJOynTTz8YHPTd24yAHjCAkhiG4exd3gM5Us 5LgiJeszewkut04gV3elbRbQpf29EPmUMTUwIEcRfE9vLfDpNwyVwoRTjmP6BswXGVYfSe/zF 9J9WWfk1sb+Q5jwdSXQXVsbATmTCaGa3564tfe+NgNyUyg90bhr9hayrx+2VrQ2U1nPAM6Z2G 3tNpOi8pAQXrzl649bYiNxLHwX9QRK6M6KC7p5J2hzB9beNb3DZwJ5jUgrnqGnXKM6VGaP4uv dh7aB205LxkAAGkEp1UyWSzV61l0jE84deGnO3GtR0zBTn4l5qoTKMQiGSGG1G+LlY7KGlFda ENK84fXiissjYa0xyD8W5q7hW3NASfuXksUIUckCI5mAfS64Hs7/U0CrAdOgVIfwq7UrLck8N On16u9QFMw0SwJUZfhhSW2F8nu3ClEBdUkzYEtdA1iM4csVoB9V4uUrpm7YgqNGY04JKem1cj Sb0YvWt03+G0GyY+KDXgtkhZVBx2J91wVnZCIX33kXcnxX52jyY1sNGZlUNevF2VbODiF/WUH g/fM9VI0oosFpshBUQZtALFQc1j4fqClnRUlQ07iNlr+05C5rv+sBnbOErOXXUheJiB4ZAv3/ Nkaj2DUd6xhBU0Npi/s2HRcULPm9Bb605OxaMJ/7BZwd+7ujAabTaIZecLe0F17/+5FY= Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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(-) I sent this patch on March 10, but it never made it in. Greg, could you apply the patch as a bugfix for 4.6? The warning is annoying as it shows up in several defconfig builds and allmodconfig. -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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, };