From patchwork Sun Jul 2 16:30:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 9821709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CF4B46035F for ; Sun, 2 Jul 2017 16:33:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C00DE27FB7 for ; Sun, 2 Jul 2017 16:33:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4DEA2810E; Sun, 2 Jul 2017 16:33:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4146727FB7 for ; Sun, 2 Jul 2017 16:33:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752282AbdGBQdE (ORCPT ); Sun, 2 Jul 2017 12:33:04 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:38888 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094AbdGBQaa (ORCPT ); Sun, 2 Jul 2017 12:30:30 -0400 From: Paul Cercueil To: Ralf Baechle , Michael Turquette , Stephen Boyd , Rob Herring Cc: Paul Burton , Maarten ter Huurne , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, linux-clk@vger.kernel.org, Paul Cercueil Subject: [PATCH v3 07/18] serial: core: Make uart_parse_options take const char* argument Date: Sun, 2 Jul 2017 18:30:05 +0200 Message-Id: <20170702163016.6714-8-paul@crapouillou.net> In-Reply-To: <20170702163016.6714-1-paul@crapouillou.net> References: <20170607200439.24450-2-paul@crapouillou.net> <20170702163016.6714-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1499013029; bh=uD3VT4wt/m1fHhLXZQONis7lQvX/4kx+mWOurhCs4o8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=oFABpAiEdWkOF7bUaCMbe5iZX+hS5Cc88G9TThm6oyC2pU5v1+n6KiOoUQPGdLscLLjLHs1vGEklnoDhTjuu1GJwzVVP8MG4gRdNFYYfCjFNkA2mI28mTgDRO1SkvcSXoI4CMFEN28W9hVMdBSew4w9qBjIjldqywrWw2veKBzM= Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pointed string is never modified from within uart_parse_options, so it should be marked as const in the function prototype. Signed-off-by: Paul Cercueil --- drivers/tty/serial/serial_core.c | 5 +++-- include/linux/serial_core.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) v2: New patch in this series v3: No change diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 13bfd5dcffce..95d3770bdb37 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1954,9 +1954,10 @@ EXPORT_SYMBOL_GPL(uart_parse_earlycon); * eg: 115200n8r */ void -uart_parse_options(char *options, int *baud, int *parity, int *bits, int *flow) +uart_parse_options(const char *options, int *baud, int *parity, + int *bits, int *flow) { - char *s = options; + const char *s = options; *baud = simple_strtoul(s, NULL, 10); while (*s >= '0' && *s <= '9') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 64d892f1e5cd..67f88fb53195 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -386,7 +386,7 @@ struct uart_port *uart_get_console(struct uart_port *ports, int nr, struct console *c); int uart_parse_earlycon(char *p, unsigned char *iotype, resource_size_t *addr, char **options); -void uart_parse_options(char *options, int *baud, int *parity, int *bits, +void uart_parse_options(const char *options, int *baud, int *parity, int *bits, int *flow); int uart_set_options(struct uart_port *port, struct console *co, int baud, int parity, int bits, int flow);