Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f646b63 authored by Paul Cercueil's avatar Paul Cercueil Committed by Greg Kroah-Hartman
Browse files

serial: core: Make uart_parse_options take const char* argument



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: default avatarPaul Cercueil <paul@crapouillou.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b9820a31
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1955,9 +1955,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')
+1 −1
Original line number Diff line number Diff line
@@ -387,7 +387,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);