[PATCH v2] net: axi_emac: Fix timeout test
Andrew Goodbody
andrew.goodbody at linaro.org
Tue Aug 19 12:54:58 CEST 2025
On 18/08/2025 14:17, Michal Simek wrote:
>
>
> On 8/18/25 13:40, Anand Moon wrote:
>> Hi Andrew,
>>
>> On Mon, 18 Aug 2025 at 14:54, Andrew Goodbody
>> <andrew.goodbody at linaro.org> wrote:
>>>
>>> The timeout test in axi_dma_init is not correct due to the
>>> post-decrement used on the timeout variable which will mean timeout is
>>> not 0 if the timeout occurs. Make the timeout variable an int instead of
>>> a u32 and then test for timeout being -1.
>>>
>>> This issue was found by Smatch.
>>>
>> You can use read_poll_timeout instead of a while loop timeout?
> he could use it but then this should be split to two reads because two
> conditions are checked and not sure if it is worth to do it.
>
> Thanks,
> Michal
I would rather not expand the scope of this patch beyond fixing the
reported issue.
Thanks,
Andrew
More information about the U-Boot
mailing list