[PATCH v1] board: ti: am33xx: Fix serial_getc comparision in spl_start_uboot()
Kory Maincent
kory.maincent at bootlin.com
Fri Sep 5 14:27:06 CEST 2025
On Fri, 5 Sep 2025 17:00:21 +0530
Sidharth Seela <sidharthseela at gmail.com> wrote:
> On Fri, Sep 5, 2025 at 4:55 PM Kory Maincent <kory.maincent at bootlin.com>
> wrote:
> >
> > This seems weird. == precede in terms of priority to &&, therefore the
> > parentheses should not be needed here.
> >
> is the issue maybe left to right interpretation of code?
Indeed inverting the condition will change the behavior, but is it really the
issue here.
With the current condition test, serial_tstc() is called then if it return
something not null, serial_getc() will read one character and compare it to
'c'.
According to documentation:
serial_tstc() - Test if data is available on currently selected serial port
serial_getc() - Read character from currently selected serial port
I think the current order is correct, we should test available data before
reading it.
Your issue may be somewhere else.
Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
More information about the U-Boot
mailing list