adc: meson-saradc: uint cannot be less than zero
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 22 Jul 2025 14:06:14 +0000 (15:06 +0100)
committerNeil Armstrong <neil.armstrong@linaro.org>
Tue, 30 Sep 2025 18:32:15 +0000 (20:32 +0200)
commitb332723882f82f6feff027fb733c4b7e43bdef80
treef8df508fc8fabbf03ce06a056d88f2376361c187
parent033dbc7f9ec969168a2f48766cb16aa26fa381d8
adc: meson-saradc: uint cannot be less than zero

timeout is declared as a uint but then tested for being less than zero
which must always fail. Change the while loop for a pre-decrement on
timeout and test timeout for being zero.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250722-meson_saradc-v1-1-1ab45d53da9d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/adc/meson-saradc.c