linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Mc Guire <der.herr@hofr.at>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Jingoo Han <jg1.han@samsung.com>,
	Denis Carikli <denis@eukrea.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nicholas Mc Guire <der.herr@hofr.at>
Subject: [PATCH] video: mx3fb: fix up wait_for_completion_timeout return handling
Date: Sun, 18 Jan 2015 01:37:02 +0000	[thread overview]
Message-ID: <1421545022-24017-1-git-send-email-der.herr@hofr.at> (raw)

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
return type of wait_for_completion_timeout is unsigned long as ret is 
used only for checking wait_for_completion_timeout here the type was
changed to unsigned long, wait_for_completion_timeout return >= 0 only
so the checks for negative return canbe dropped.

This patch was only compiletested using imx_v4_v5_defconfig                     

Patch is against 3.19.0-rc4 -next-20150116

 drivers/video/fbdev/mx3fb.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 7947634..523134f 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -1144,7 +1144,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
 	struct scatterlist *sg = mx3_fbi->sg;
 	struct dma_chan *dma_chan = &mx3_fbi->idmac_channel->dma_chan;
 	struct dma_async_tx_descriptor *txd;
-	int ret;
+	unsigned long ret;
 
 	dev_dbg(fbi->device, "%s [%c]\n", __func__,
 		list_empty(&mx3_fbi->idmac_channel->queue) ? '-' : '+');
@@ -1184,12 +1184,11 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
 	enable_irq(mx3_fbi->idmac_channel->eof_irq);
 
 	ret = wait_for_completion_timeout(&mx3_fbi->flip_cmpl, HZ / 10);
-	if (ret <= 0) {
+	if (ret = 0) {
 		mutex_unlock(&mx3_fbi->mutex);
-		dev_info(fbi->device, "Panning failed due to %s\n", ret < 0 ?
-			 "user interrupt" : "timeout");
+		dev_info(fbi->device, "Panning failed due to timeout\n");
 		disable_irq(mx3_fbi->idmac_channel->eof_irq);
-		return ret ? : -ETIMEDOUT;
+		return -ETIMEDOUT;
 	}
 
 	mx3_fbi->cur_ipu_buf = !mx3_fbi->cur_ipu_buf;
-- 
1.7.10.4


                 reply	other threads:[~2015-01-18  1:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421545022-24017-1-git-send-email-der.herr@hofr.at \
    --to=der.herr@hofr.at \
    --cc=daniel.vetter@ffwll.ch \
    --cc=denis@eukrea.com \
    --cc=geert+renesas@glider.be \
    --cc=jg1.han@samsung.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).