Skip to contentSkip to conversation

video: pxa3xx-gcu: Simplify the logic to exit while loop in pxa3xx_gcu_wait_idle

PATCH Applied Axel Lin 2 participants 2 messages Mar 27, 2012 – Apr 12, 2012 Framebuffer layer

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/video/pxa3xx-gcu.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/video/pxa3xx-gcu.c +1 -4
index 1d71c08..0b4ae0c 100644
@@ -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");
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 7 lines · Axel Lin

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.

Applied.

Thanks,

Florian Tobias Schandinat

Quoted 22 lines
---
 drivers/video/pxa3xx-gcu.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/video/pxa3xx-gcu.c +1 -4
index 1d71c08..0b4ae0c 100644
@@ -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");