Skip to content

Commit 7dbbbb1

Browse files
Wolfram Sangbroonie
authored andcommitted
spi: armada-3700: 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. Fix to the proper variable type 'unsigned long' while here. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 4776679 commit 7dbbbb1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/spi/spi-armada-3700.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static irqreturn_t a3700_spi_interrupt(int irq, void *dev_id)
339339
static bool a3700_spi_wait_completion(struct spi_device *spi)
340340
{
341341
struct a3700_spi *a3700_spi;
342-
unsigned int timeout;
342+
unsigned long time_left;
343343
unsigned int ctrl_reg;
344344
unsigned long timeout_jiffies;
345345

@@ -361,12 +361,12 @@ static bool a3700_spi_wait_completion(struct spi_device *spi)
361361
a3700_spi->wait_mask);
362362

363363
timeout_jiffies = msecs_to_jiffies(A3700_SPI_TIMEOUT);
364-
timeout = wait_for_completion_timeout(&a3700_spi->done,
365-
timeout_jiffies);
364+
time_left = wait_for_completion_timeout(&a3700_spi->done,
365+
timeout_jiffies);
366366

367367
a3700_spi->wait_mask = 0;
368368

369-
if (timeout)
369+
if (time_left)
370370
return true;
371371

372372
/* there might be the case that right after we checked the

0 commit comments

Comments
 (0)