[PATCH] x86: Update cbmem driver
Alex Sadovsky
nable.maininbox at googlemail.com
Mon Aug 14 05:03:48 CEST 2023
Dear Simon and other developers,
> - cursor = cbmem_console_p->buffer_cursor++;
> - if (cursor < cbmem_console_p->buffer_size)
> - cbmem_console_p->buffer_body[cursor] = data;
> + pos = cons->cursor++;
> + if (pos < cons->size)
> + cons->body[pos] = data;
While at it, is it OK to increment cons->cursor unconditionally,
even when the buffer is full?
It's better to do it after the check, isn't it? E.g.:
if (cons->cursor < cons->size)
cons->body[cons->cursor++] = data;
Cheers, Alex.
More information about the U-Boot
mailing list