Re: [PATCH 0/2] mtd: use 'time_left' instead of 'timeout' with wait_*() functions

From: Miquel Raynal
Date: Wed Jun 05 2024 - 03:46:49 EST


Hi Wolfram,

wsa+renesas@xxxxxxxxxxxxxxxxxxxx wrote on Tue, 4 Jun 2024 23:29:19
+0200:

> There is a confusing pattern in the kernel to use a variable named 'timeout' to
> store the result of wait_*() functions causing patterns like:
>
> timeout = wait_for_completion_timeout(...)
> if (!timeout) return -ETIMEDOUT;
>
> with all kinds of permutations. Use 'time_left' as a variable to make the code
> obvious and self explaining.

Good idea. The waiting functions are generally confusing because the
semantics of the return values are different, so this is a good first
step, I'll take them through mtd-next soon.

Thanks,
Miquèl