dmaengine: tegra-apb: Remove unnecessary return statements and variables
authorJon Hunter <jonathanh@nvidia.com>
Thu, 6 Aug 2015 13:32:32 +0000 (14:32 +0100)
committerVinod Koul <vinod.koul@intel.com>
Thu, 20 Aug 2015 06:40:21 +0000 (12:10 +0530)
Some void functions have unnecessary return statements at the end
(reported by sparse) and so remove these. Also remove the return variables
from functions tegra_dma_prep_slave_sg() and tegra_dma_prep_slave_cyclic()
because the value is not used.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/tegra20-apb-dma.c

index 11edcca7619bb4f0cd600a26e73a6f863065af40..53a8075dcec80f470f42304d93c68aa94963cc5c 100644 (file)
@@ -598,7 +598,6 @@ static void handle_once_dma_done(struct tegra_dma_channel *tdc,
                return;
 
        tdc_start_head_req(tdc);
-       return;
 }
 
 static void handle_cont_sngl_cycle_dma_done(struct tegra_dma_channel *tdc,
@@ -625,7 +624,6 @@ static void handle_cont_sngl_cycle_dma_done(struct tegra_dma_channel *tdc,
                if (!st)
                        dma_desc->dma_status = DMA_ERROR;
        }
-       return;
 }
 
 static void tegra_dma_tasklet(unsigned long data)
@@ -717,7 +715,6 @@ static void tegra_dma_issue_pending(struct dma_chan *dc)
        }
 end:
        spin_unlock_irqrestore(&tdc->lock, flags);
-       return;
 }
 
 static int tegra_dma_terminate_all(struct dma_chan *dc)
@@ -929,7 +926,6 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
        struct tegra_dma_sg_req  *sg_req = NULL;
        u32 burst_size;
        enum dma_slave_buswidth slave_bw;
-       int ret;
 
        if (!tdc->config_init) {
                dev_err(tdc2dev(tdc), "dma channel is not configured\n");
@@ -940,9 +936,8 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_slave_sg(
                return NULL;
        }
 
-       ret = get_transfer_param(tdc, direction, &apb_ptr, &apb_seq, &csr,
-                               &burst_size, &slave_bw);
-       if (ret < 0)
+       if (get_transfer_param(tdc, direction, &apb_ptr, &apb_seq, &csr,
+                               &burst_size, &slave_bw) < 0)
                return NULL;
 
        INIT_LIST_HEAD(&req_list);
@@ -1045,7 +1040,6 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
        dma_addr_t mem = buf_addr;
        u32 burst_size;
        enum dma_slave_buswidth slave_bw;
-       int ret;
 
        if (!buf_len || !period_len) {
                dev_err(tdc2dev(tdc), "Invalid buffer/period len\n");
@@ -1084,12 +1078,10 @@ static struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
                return NULL;
        }
 
-       ret = get_transfer_param(tdc, direction, &apb_ptr, &apb_seq, &csr,
-                               &burst_size, &slave_bw);
-       if (ret < 0)
+       if (get_transfer_param(tdc, direction, &apb_ptr, &apb_seq, &csr,
+                               &burst_size, &slave_bw) < 0)
                return NULL;
 
-
        ahb_seq = TEGRA_APBDMA_AHBSEQ_INTR_ENB;
        ahb_seq |= TEGRA_APBDMA_AHBSEQ_WRAP_NONE <<
                                        TEGRA_APBDMA_AHBSEQ_WRAP_SHIFT;