From: Axel Lin Date: Tue, 27 Mar 2012 03:15:56 +0000 (+0800) Subject: video: pxa3xx-gcu: Simplify the logic to exit while loop in pxa3xx_gcu_wait_idle X-Git-Tag: v3.5-rc1~7^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=688ec344a62e85f221d7a310a1209cf9b1209fd3;p=profile%2Fcommon%2Fkernel-common.git video: pxa3xx-gcu: Simplify the logic to exit while loop in pxa3xx_gcu_wait_idle If wait_event_interruptible_timeout returns a positive value, it means the condition evaluated is true. Which means priv->shared->hw_running is false. And then we will exit the loop. This patch simplifies the logic to exit the while loop. Signed-off-by: Axel Lin Signed-off-by: Florian Tobias Schandinat --- diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c index 1d71c08..0b4ae0c 100644 --- a/drivers/video/pxa3xx-gcu.c +++ b/drivers/video/pxa3xx-gcu.c @@ -316,12 +316,9 @@ pxa3xx_gcu_wait_idle(struct pxa3xx_gcu_priv *priv) ret = wait_event_interruptible_timeout(priv->wait_idle, !priv->shared->hw_running, HZ*4); - if (ret < 0) + if (ret != 0) break; - if (ret > 0) - continue; - if (gc_readl(priv, REG_GCRBEXHR) == rbexhr && priv->shared->num_interrupts == num) { QERROR("TIMEOUT");