public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/exynos: fix a timeout loop
@ 2016-10-13 10:20 Dan Carpenter
  2016-10-13 11:05 ` Tobias Jakobi
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-10-13 10:20 UTC (permalink / raw)
  To: Inki Dae, Tobias Jakobi
  Cc: linux-samsung-soc, kernel-janitors, Seung-Woo Kim,
	Krzysztof Kozlowski, Javier Martinez Canillas, Kyungmin Park,
	Kukjin Kim, dri-devel

We were trying to print an error message if we timed out here, but the
loop actually ends with "tries" set to UINT_MAX and not zero.  Fix this
by changing from tries-- to --tries.

A for loop would actually be the most natural way to do this.  My fix
means we only loop 99 times instead of 100 but that's probably ok.

Fixes: a696394c5224 ('drm/exynos: mixer: simplify loop in vp_win_reset()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index edb20a3..fcc7e4f 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -701,7 +701,7 @@ static void vp_win_reset(struct mixer_context *ctx)
 	unsigned int tries = 100;
 
 	vp_reg_write(res, VP_SRESET, VP_SRESET_PROCESSING);
-	while (tries--) {
+	while (--tries) {
 		/* waiting until VP_SRESET_PROCESSING is 0 */
 		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
 			break;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-13 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13 10:20 [patch] drm/exynos: fix a timeout loop Dan Carpenter
2016-10-13 11:05 ` Tobias Jakobi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox