lkml.org 
[lkml]   [2018]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 6/6] x86/boot: Support nocfg parameter for earlyprintk

* Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> @@ -133,12 +135,16 @@ static void parse_earlyprintk(void)
> if (arg[pos] == ',')
> pos++;
>
> - baud = simple_strtoull(arg + pos, &e, 0);
> - if (baud == 0 || arg + pos == e)
> - baud = DEFAULT_BAUD;
> + if (strncmp(arg + pos, "nocfg", 5)) {
> + baud = simple_strtoull(arg + pos, &e, 0);
> + if (baud == 0 || arg + pos == e)
> + baud = DEFAULT_BAUD;
> + } else {
> + configure = false;
> + }
> }
>
> - early_serial_init(port, baud);
> + early_serial_init(port, baud, configure);
> }
>
> #define BASE_BAUD (1843200/16)
> @@ -162,6 +168,7 @@ static void parse_console_uart8250(void)
> char optstr[64], *options;
> int baud = DEFAULT_BAUD;
> unsigned long port = 0;
> + bool configure = true;
>
> /*
> * console=uart8250,io,0x3f8,115200n8
> @@ -179,12 +186,16 @@ static void parse_console_uart8250(void)
> else
> return;
>
> - if (options && (options[0] == ','))
> - baud = simple_strtoull(options + 1, &options, 0);
> - else
> + if (options[0] == ',') {
> + if (strncmp(options + 1, "nocfg", 5))
> + baud = simple_strtoull(options + 1, &options, 0);
> + else
> + configure = false;
> + } else {
> baud = probe_baud(port);

These code patters seem very similar - could a common function be factored out, to
simplify future changes (such as the one done here)?

Thanks,

Ingo

\
 
 \ /
  Last update: 2018-01-16 04:13    [W:0.125 / U:21.888 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site