diff mbox

drm/radeon: tweak a timeout condition slightly

Message ID 20131006003723.GB16592@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Oct. 6, 2013, 12:37 a.m. UTC
The code was supposed to loop 10 times but it loops 11 times because it
uses a post op instead of pre op.  Using parenthesis doesn't affect how
post ops work.

Also I have clarified the comment.  Hopefully I understood the intent
correctly.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checkers stuff.  I haven't tested this.  I was auditing for post
op vs pre op increments.  It turns out that some people always put
parenthesis around increment operations for style reasons so it's also
possible that the intent was to loop 11 times.
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index ddb8f8e..fc6e9f4 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -180,11 +180,10 @@  void radeon_fence_process(struct radeon_device *rdev, int ring)
 		 */
 		wake = true;
 		last_seq = seq;
-		if ((count_loop++) > 10) {
-			/* We looped over too many time leave with the
-			 * fact that we might have set an older fence
-			 * seq then the current real last seq as signaled
-			 * by the hw.
+		if (++count_loop > 10) {
+			/* We have looped too many times.  Leave despite the
+			 * fact that we might have set an older fence seq than
+			 * the current real last_seq as signaled by the hw.
 			 */
 			break;
 		}