Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: atmel-isi: 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 <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Wolfram Sang and committed by
Hans Verkuil
64979ac2 0016b5a5

+4 -4
+4 -4
drivers/media/platform/atmel/atmel-isi.c
··· 242 242 #define WAIT_ISI_DISABLE 0 243 243 static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset) 244 244 { 245 - unsigned long timeout; 245 + unsigned long time_left; 246 246 /* 247 247 * The reset or disable will only succeed if we have a 248 248 * pixel clock from the camera. ··· 257 257 isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); 258 258 } 259 259 260 - timeout = wait_for_completion_timeout(&isi->complete, 261 - msecs_to_jiffies(500)); 262 - if (timeout == 0) 260 + time_left = wait_for_completion_timeout(&isi->complete, 261 + msecs_to_jiffies(500)); 262 + if (time_left == 0) 263 263 return -ETIMEDOUT; 264 264 265 265 return 0;