Skip to content

Commit e33df1c

Browse files
Wolfram Sangmiquelraynal
authored andcommitted
mtd: rawnand: intel: 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 <wsa+renesas@sang-engineering.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240604212919.5038-6-wsa+renesas@sang-engineering.com
1 parent bf66d81 commit e33df1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/mtd/nand/raw/intel-nand-controller.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static int ebu_dma_start(struct ebu_nand_controller *ebu_host, u32 dir,
295295
unsigned long flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
296296
dma_addr_t buf_dma;
297297
int ret;
298-
u32 timeout;
298+
unsigned long time_left;
299299

300300
if (dir == DMA_DEV_TO_MEM) {
301301
chan = ebu_host->dma_rx;
@@ -335,8 +335,8 @@ static int ebu_dma_start(struct ebu_nand_controller *ebu_host, u32 dir,
335335
dma_async_issue_pending(chan);
336336

337337
/* Wait DMA to finish the data transfer.*/
338-
timeout = wait_for_completion_timeout(dma_completion, msecs_to_jiffies(1000));
339-
if (!timeout) {
338+
time_left = wait_for_completion_timeout(dma_completion, msecs_to_jiffies(1000));
339+
if (!time_left) {
340340
dev_err(ebu_host->dev, "I/O Error in DMA RX (status %d)\n",
341341
dmaengine_tx_status(chan, cookie, NULL));
342342
dmaengine_terminate_sync(chan);

0 commit comments

Comments
 (0)