lkml.org 
[lkml]   [2012]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 6/7] mx3fb: Fix the usage of wait_for_completion_timeout
From
Date

The return value of wait_for_completion_timeout() is always
>= 0 with unsigned int type.

So the condition "ret < 0" or "ret >= 0" is pointless.

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
---
drivers/video/mx3fb.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index ce1d452..88bf368 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -1110,12 +1110,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.0.4




\
 
 \ /
  Last update: 2012-11-06 10:23    [W:0.064 / U:1.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site