Skip to content

Commit 4168ced

Browse files
Wolfram SangXu Yilun
authored andcommitted
fpga: socfpga: 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_interruptible_timeout() causing patterns like: timeout = wait_for_completion_interruptible_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 'long' while here. Signed-off-by: Wolfram Sang <[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 d783ed2 commit 4168ced

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/fpga/socfpga.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,17 @@ static irqreturn_t socfpga_fpga_isr(int irq, void *dev_id)
301301

302302
static int socfpga_fpga_wait_for_config_done(struct socfpga_fpga_priv *priv)
303303
{
304-
int timeout, ret = 0;
304+
int ret = 0;
305+
long time_left;
305306

306307
socfpga_fpga_disable_irqs(priv);
307308
init_completion(&priv->status_complete);
308309
socfpga_fpga_enable_irqs(priv, SOCFPGA_FPGMGR_MON_CONF_DONE);
309310

310-
timeout = wait_for_completion_interruptible_timeout(
311+
time_left = wait_for_completion_interruptible_timeout(
311312
&priv->status_complete,
312313
msecs_to_jiffies(10));
313-
if (timeout == 0)
314+
if (time_left == 0)
314315
ret = -ETIMEDOUT;
315316

316317
socfpga_fpga_disable_irqs(priv);

0 commit comments

Comments
 (0)