Thread (92 messages) 92 messages, 7 authors, 2017-12-29

Re: [PATCH 06/15] serial: 8250_ingenic: Parse earlycon options

From: Paul Cercueil <paul@crapouillou.net>
Date: 2017-06-08 21:12:16
Also in: linux-clk, linux-mips, lkml

Hi,

[...]
quoted
diff --git a/drivers/tty/serial/8250/8250_ingenic.c 
b/drivers/tty/serial/8250/8250_ingenic.c
index b31b2ca552d1..59f3e632df49 100644
--- a/drivers/tty/serial/8250/8250_ingenic.c
+++ b/drivers/tty/serial/8250/8250_ingenic.c
@@ -99,14 +99,24 @@ static int __init 
ingenic_early_console_setup(struct earlycon_device *dev,
  					      const char *opt)
  {
  	struct uart_port *port = &dev->port;
-	unsigned int baud, divisor;
+	unsigned int divisor;
+	int baud = 115200;
    	if (!dev->port.membase)
  		return -ENODEV;
  +	if (opt) {
+		char options[256];
+		unsigned int parity, bits, flow; /* unused for now */
+
+		strlcpy(options, opt, sizeof(options));
Rather than adding this extra local copy maybe you could instead:

-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,

I cannot see any reason why uart_parse_options shouldn't take 'const
char *options' as an argument.
Sure, good remark. I'll send a patch to change the prototype.

Thanks,
- Paul
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help