Skip to content

Commit 8de3678

Browse files
Wolfram SangXu Yilun
authored andcommitted
fpga: zynq-fpga: Rename 'timeout' variable as 'time_left'
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]> Acked-by: Michal Simek <[email protected]> Acked-by: Xu Yilun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xu Yilun <[email protected]>
1 parent 4168ced commit 8de3678

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/fpga/zynq-fpga.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr, struct sg_table *sgt)
387387
const char *why;
388388
int err;
389389
u32 intr_status;
390-
unsigned long timeout;
390+
unsigned long time_left;
391391
unsigned long flags;
392392
struct scatterlist *sg;
393393
int i;
@@ -427,8 +427,8 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr, struct sg_table *sgt)
427427
zynq_step_dma(priv);
428428
spin_unlock_irqrestore(&priv->dma_lock, flags);
429429

430-
timeout = wait_for_completion_timeout(&priv->dma_done,
431-
msecs_to_jiffies(DMA_TIMEOUT_MS));
430+
time_left = wait_for_completion_timeout(&priv->dma_done,
431+
msecs_to_jiffies(DMA_TIMEOUT_MS));
432432

433433
spin_lock_irqsave(&priv->dma_lock, flags);
434434
zynq_fpga_set_irq(priv, 0);
@@ -452,7 +452,7 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr, struct sg_table *sgt)
452452

453453
if (priv->cur_sg ||
454454
!((intr_status & IXR_D_P_DONE_MASK) == IXR_D_P_DONE_MASK)) {
455-
if (timeout == 0)
455+
if (time_left == 0)
456456
why = "DMA timed out";
457457
else
458458
why = "DMA did not complete";

0 commit comments

Comments
 (0)