Skip to content

Commit bf66d81

Browse files
Wolfram Sangmiquelraynal
authored andcommitted
mtd: rawnand: mxc: 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]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent cbbfb0b commit bf66d81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/mtd/nand/raw/mxc_nand.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,14 @@ static int wait_op_done(struct mxc_nand_host *host, int useirq)
457457
return 0;
458458

459459
if (useirq) {
460-
unsigned long timeout;
460+
unsigned long time_left;
461461

462462
reinit_completion(&host->op_completion);
463463

464464
irq_control(host, 1);
465465

466-
timeout = wait_for_completion_timeout(&host->op_completion, HZ);
467-
if (!timeout && !host->devtype_data->check_int(host)) {
466+
time_left = wait_for_completion_timeout(&host->op_completion, HZ);
467+
if (!time_left && !host->devtype_data->check_int(host)) {
468468
dev_dbg(host->dev, "timeout waiting for irq\n");
469469
ret = -ETIMEDOUT;
470470
}

0 commit comments

Comments
 (0)