Commit b09b6f26 authored by Wolfram Sang's avatar Wolfram Sang Committed by Hans Verkuil
Browse files

media: solo6x10: 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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarIsmael Luceno <ismael@iodev.co.uk>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 24a19e4b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev,
		      int desc_cnt)
{
	struct solo_p2m_dev *p2m_dev;
	unsigned int timeout;
	unsigned long time_left;
	unsigned int config = 0;
	int ret = 0;
	unsigned int p2m_id = 0;
@@ -99,12 +99,12 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev,
			       desc[1].ctrl);
	}

	timeout = wait_for_completion_timeout(&p2m_dev->completion,
	time_left = wait_for_completion_timeout(&p2m_dev->completion,
						solo_dev->p2m_jiffies);

	if (WARN_ON_ONCE(p2m_dev->error))
		ret = -EIO;
	else if (timeout == 0) {
	else if (time_left == 0) {
		solo_dev->p2m_timeouts++;
		ret = -EAGAIN;
	}