Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 98f9e44

Browse files
Wolfram Sangherbertx
authored andcommitted
crypto: api - use 'time_left' variable with wait_for_completion_killable_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_killable_timeout() causing patterns like: timeout = wait_for_completion_killable_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent d283570 commit 98f9e44

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crypto/api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,18 @@ static void crypto_start_test(struct crypto_larval *larval)
202202
static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
203203
{
204204
struct crypto_larval *larval = (void *)alg;
205-
long timeout;
205+
long time_left;
206206

207207
if (!crypto_boot_test_finished())
208208
crypto_start_test(larval);
209209

210-
timeout = wait_for_completion_killable_timeout(
210+
time_left = wait_for_completion_killable_timeout(
211211
&larval->completion, 60 * HZ);
212212

213213
alg = larval->adult;
214-
if (timeout < 0)
214+
if (time_left < 0)
215215
alg = ERR_PTR(-EINTR);
216-
else if (!timeout)
216+
else if (!time_left)
217217
alg = ERR_PTR(-ETIMEDOUT);
218218
else if (!alg)
219219
alg = ERR_PTR(-ENOENT);

0 commit comments

Comments
 (0)