Skip to contentSkip to conversation

media: ti-vpe: vpdma: fix a timeout loop

PATCH In review Dan Carpenter 2 participants 2 messages Nov 25, 2016 – Nov 28, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: ti-vpe: vpdma: fix a timeout loop

The check assumes that we end on zero but actually we end on -1. Change the post-op to a pre-op so that we do end on zero. Techinically now we only loop 499 times instead of 500 but that's fine.

Fixes dc12b124353b ("[media] media: ti-vpe: vpdma: Add abort channel desc and cleanup APIs")
drivers/media/platform/ti-vpe/vpdma.c +1 -1
index 13bfd71..23472e3 100644
@@ -453,7 +453,7 @@ int vpdma_list_cleanup(struct vpdma_data *vpdma, int list_num,
 	if (ret)
 		return ret;
 
-	while (vpdma_list_busy(vpdma, list_num) && timeout--)
+	while (vpdma_list_busy(vpdma, list_num) && --timeout)
 		;
 
 	if (timeout = 0) {
Acked-by on v1 1/1
#1 lore raw

Dan,

Thanks for the patch.

Dan Carpenter <[email protected]> wrote on Sat [2016-Nov-26 00:28:34 +0300]:

Quoted 20 lines

The check assumes that we end on zero but actually we end on -1. Change the post-op to a pre-op so that we do end on zero. Techinically now we only loop 499 times instead of 500 but that's fine.

Fixes dc12b124353b ("[media] media: ti-vpe: vpdma: Add abort channel desc and cleanup APIs")
drivers/media/platform/ti-vpe/vpdma.c +1 -1
index 13bfd71..23472e3 100644
@@ -453,7 +453,7 @@ int vpdma_list_cleanup(struct vpdma_data *vpdma, int list_num,
 	if (ret)
 		return ret;
 
-	while (vpdma_list_busy(vpdma, list_num) && timeout--)
+	while (vpdma_list_busy(vpdma, list_num) && --timeout)
 		;
 
 	if (timeout = 0) {