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

Miquel Raynal miquel.raynal at bootlin.com
Wed Jun 5 00:43:59 PDT 2024


Hi Wolfram,

wsa+renesas at sang-engineering.com 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



More information about the linux-mtd mailing list