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

media: bdisp: use 'time_left' variable with wait_event_timeout()

There is a confusing pattern in the kernel to use a variable named
'timeout' to store the result of wait_event_timeout() causing
patterns like:

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

authored by

Wolfram Sang and committed by
Hans Verkuil
9b2bf294 64979ac2

+5 -5
+5 -5
drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c
··· 1160 1160 static int bdisp_m2m_suspend(struct bdisp_dev *bdisp) 1161 1161 { 1162 1162 unsigned long flags; 1163 - int timeout; 1163 + long time_left; 1164 1164 1165 1165 spin_lock_irqsave(&bdisp->slock, flags); 1166 1166 if (!test_bit(ST_M2M_RUNNING, &bdisp->state)) { ··· 1171 1171 set_bit(ST_M2M_SUSPENDING, &bdisp->state); 1172 1172 spin_unlock_irqrestore(&bdisp->slock, flags); 1173 1173 1174 - timeout = wait_event_timeout(bdisp->irq_queue, 1175 - test_bit(ST_M2M_SUSPENDED, &bdisp->state), 1176 - BDISP_WORK_TIMEOUT); 1174 + time_left = wait_event_timeout(bdisp->irq_queue, 1175 + test_bit(ST_M2M_SUSPENDED, &bdisp->state), 1176 + BDISP_WORK_TIMEOUT); 1177 1177 1178 1178 clear_bit(ST_M2M_SUSPENDING, &bdisp->state); 1179 1179 1180 - if (!timeout) { 1180 + if (!time_left) { 1181 1181 dev_err(bdisp->dev, "%s IRQ timeout\n", __func__); 1182 1182 return -EAGAIN; 1183 1183 }