[PATCH v2] net: axi_emac: Fix timeout test

Michal Simek michal.simek at amd.com
Mon Aug 18 15:17:59 CEST 2025



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


More information about the U-Boot mailing list