Message ID | 20200903131311.442255-2-dwlsalmeida@gmail.com |
---|---|
State | New |
Headers | show |
Series | None | expand |
diff --git a/drivers/media/platform/ti-vpe/vpdma.c b/drivers/media/platform/ti-vpe/vpdma.c index 2e5148ae7a0f..5893917ce50d 100644 --- a/drivers/media/platform/ti-vpe/vpdma.c +++ b/drivers/media/platform/ti-vpe/vpdma.c @@ -942,14 +942,13 @@ int vpdma_hwlist_alloc(struct vpdma_data *vpdma, void *priv) unsigned long flags; spin_lock_irqsave(&vpdma->lock, flags); - for (i = 0; i < VPDMA_MAX_NUM_LIST && - vpdma->hwlist_used[i] == true; i++) - ; - - if (i < VPDMA_MAX_NUM_LIST) { + for (i = 0; i < VPDMA_MAX_NUM_LIST; i++) { + if (vpdma->hwlist_used[i]) + continue; list_num = i; vpdma->hwlist_used[i] = true; vpdma->hwlist_priv[i] = priv; + break; } spin_unlock_irqrestore(&vpdma->lock, flags);