Re: [PATCH] firmware: turris-mox-rwtm: Fix return value check of wait_for_completion_timeout

From: Marek Behún
Date: Mon Apr 11 2022 - 12:08:51 EST


On Mon, 11 Apr 2022 10:45:38 +0000
Miaoqian Lin <linmq006@xxxxxxxxx> wrote:

> wait_for_completion_timeout() returns unsigned long not int.
> It returns 0 if timed out, and positive if completed.
> The check for <= 0 is ambiguous and should be == 0 here
> indicating timeout which is the only error case
>
> Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver")
> Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx>

Reviewed-by: Marek Behún <kabel@xxxxxxxxxx>