Skip to content

Commit 8dacd79

Browse files
Wolfram SangAndi Shyti
authored andcommitted
i2c: imx-lpi2c: use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() 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 self explaining. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent b557e26 commit 8dacd79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/i2c/busses/i2c-imx-lpi2c.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ static int lpi2c_imx_master_disable(struct lpi2c_imx_struct *lpi2c_imx)
307307

308308
static int lpi2c_imx_msg_complete(struct lpi2c_imx_struct *lpi2c_imx)
309309
{
310-
unsigned long timeout;
310+
unsigned long time_left;
311311

312-
timeout = wait_for_completion_timeout(&lpi2c_imx->complete, HZ);
312+
time_left = wait_for_completion_timeout(&lpi2c_imx->complete, HZ);
313313

314-
return timeout ? 0 : -ETIMEDOUT;
314+
return time_left ? 0 : -ETIMEDOUT;
315315
}
316316

317317
static int lpi2c_imx_txfifo_empty(struct lpi2c_imx_struct *lpi2c_imx)

0 commit comments

Comments
 (0)