lkml.org 
[lkml]   [2020]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 4/4] kdb: Switch to use safer dbg_io_ops over console APIs
Hi,

On Thu, Jun 4, 2020 at 3:02 AM Sumit Garg <sumit.garg@linaro.org> wrote:
>
> @@ -433,7 +432,8 @@ static int kgdboc_earlycon_get_char(void)
> {
> char c;
>
> - if (!earlycon->read(earlycon, &c, 1))
> + if (!kgdboc_earlycon_io_ops.cons->read(kgdboc_earlycon_io_ops.cons,
> + &c, 1))
> return NO_POLL_CHAR;
>
> return c;
> @@ -441,7 +441,8 @@ static int kgdboc_earlycon_get_char(void)
>
> static void kgdboc_earlycon_put_char(u8 chr)
> {
> - earlycon->write(earlycon, &chr, 1);
> + kgdboc_earlycon_io_ops.cons->write(kgdboc_earlycon_io_ops.cons, &chr,
> + 1);
> }

The get_char / put_char functions are pretty unwieldy now. If it were
me I would have done:

struct console *con = kgdboc_earlycon_io_ops.cons;

...and then used it so the lines didn't wrap in such a terrible way. ;-)

I'm not sure if I'd spin just for that, though.

Reviewed-by: Douglas Anderson <dianders@chromium.org>

-Doug

\
 
 \ /
  Last update: 2020-06-04 23:13    [W:1.453 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site