diff mbox series

[v8,11/19] dmaengine: tegra-apb: Remove duplicated pending_sg_req checks

Message ID 20200209163356.6439-12-digetx@gmail.com
State Accepted
Headers show
Series NVIDIA Tegra APB DMA driver fixes and improvements | expand

Commit Message

Dmitry Osipenko Feb. 9, 2020, 4:33 p.m. UTC
There are few place in the code which check whether pending_sg_req list is
empty despite of the check already being done. Let's remove the duplicated
checks to keep code clean.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/dma/tegra20-apb-dma.c | 12 ------------
 1 file changed, 12 deletions(-)

Comments

Jon Hunter Feb. 14, 2020, 2:13 p.m. UTC | #1
On 09/02/2020 16:33, Dmitry Osipenko wrote:
> There are few place in the code which check whether pending_sg_req list is
> empty despite of the check already being done. Let's remove the duplicated
> checks to keep code clean.
> 
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/dma/tegra20-apb-dma.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index 22b88ccff05d..049e98ae1240 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -504,9 +504,6 @@ static void tdc_start_head_req(struct tegra_dma_channel *tdc)
>  {
>  	struct tegra_dma_sg_req *sg_req;
>  
> -	if (list_empty(&tdc->pending_sg_req))
> -		return;
> -
>  	sg_req = list_first_entry(&tdc->pending_sg_req, typeof(*sg_req), node);
>  	tegra_dma_start(tdc, sg_req);
>  	sg_req->configured = true;
> @@ -518,9 +515,6 @@ static void tdc_configure_next_head_desc(struct tegra_dma_channel *tdc)
>  {
>  	struct tegra_dma_sg_req *hsgreq, *hnsgreq;
>  
> -	if (list_empty(&tdc->pending_sg_req))
> -		return;
> -
>  	hsgreq = list_first_entry(&tdc->pending_sg_req, typeof(*hsgreq), node);
>  	if (!list_is_last(&hsgreq->node, &tdc->pending_sg_req)) {
>  		hnsgreq = list_first_entry(&hsgreq->node, typeof(*hnsgreq),
> @@ -567,12 +561,6 @@ static bool handle_continuous_head_request(struct tegra_dma_channel *tdc,
>  {
>  	struct tegra_dma_sg_req *hsgreq;
>  
> -	if (list_empty(&tdc->pending_sg_req)) {
> -		dev_err(tdc2dev(tdc), "DMA is running without req\n");
> -		tegra_dma_stop(tdc);
> -		return false;
> -	}
> -
>  	/*
>  	 * Check that head req on list should be in flight.
>  	 * If it is not in flight then abort transfer as
> 

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Thanks
Jon
diff mbox series

Patch

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 22b88ccff05d..049e98ae1240 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -504,9 +504,6 @@  static void tdc_start_head_req(struct tegra_dma_channel *tdc)
 {
 	struct tegra_dma_sg_req *sg_req;
 
-	if (list_empty(&tdc->pending_sg_req))
-		return;
-
 	sg_req = list_first_entry(&tdc->pending_sg_req, typeof(*sg_req), node);
 	tegra_dma_start(tdc, sg_req);
 	sg_req->configured = true;
@@ -518,9 +515,6 @@  static void tdc_configure_next_head_desc(struct tegra_dma_channel *tdc)
 {
 	struct tegra_dma_sg_req *hsgreq, *hnsgreq;
 
-	if (list_empty(&tdc->pending_sg_req))
-		return;
-
 	hsgreq = list_first_entry(&tdc->pending_sg_req, typeof(*hsgreq), node);
 	if (!list_is_last(&hsgreq->node, &tdc->pending_sg_req)) {
 		hnsgreq = list_first_entry(&hsgreq->node, typeof(*hnsgreq),
@@ -567,12 +561,6 @@  static bool handle_continuous_head_request(struct tegra_dma_channel *tdc,
 {
 	struct tegra_dma_sg_req *hsgreq;
 
-	if (list_empty(&tdc->pending_sg_req)) {
-		dev_err(tdc2dev(tdc), "DMA is running without req\n");
-		tegra_dma_stop(tdc);
-		return false;
-	}
-
 	/*
 	 * Check that head req on list should be in flight.
 	 * If it is not in flight then abort transfer as