]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
video: pxa3xx-gcu: Simplify the logic to exit while loop in pxa3xx_gcu_wait_idle
authorAxel Lin <axel.lin@gmail.com>
Tue, 27 Mar 2012 03:15:56 +0000 (11:15 +0800)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Mon, 9 Apr 2012 16:18:15 +0000 (16:18 +0000)
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 <axel.lin@gmail.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
drivers/video/pxa3xx-gcu.c

index 1d71c08a818f7d1fc646496f9ae9c32d77943c88..0b4ae0cebedaf7c0a6b9c8f3d262d7917ecf8911 100644 (file)
@@ -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");