Skip to content

Commit

Permalink
dmaengine: tegra: Fix uninitialized variable usage
Browse files Browse the repository at this point in the history
Initialize slave_bw in dma_prep*() functions as the parameter is not
set for DMA_MEM_TO_MEM case in get_transfer_param(). Though the case
may never occur, initializing it avoids warning from certain static
checkers

Fixes: ee17028 ("dmaengine: tegra: Add tegra gpcdma driver")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://lore.kernel.org/r/20220426101913.43335-2-akhilrajeev@nvidia.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Akhil R authored and Vinod Koul committed May 19, 2022
1 parent 099a9a9 commit 39b930b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/dma/tegra186-gpc-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,8 @@ tegra_dma_prep_slave_sg(struct dma_chan *dc, struct scatterlist *sgl,
{
struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc);
unsigned int max_dma_count = tdc->tdma->chip_data->max_dma_count;
enum dma_slave_buswidth slave_bw = DMA_SLAVE_BUSWIDTH_UNDEFINED;
u32 csr, mc_seq, apb_ptr = 0, mmio_seq = 0;
enum dma_slave_buswidth slave_bw;
struct tegra_dma_sg_req *sg_req;
struct tegra_dma_desc *dma_desc;
struct scatterlist *sg;
Expand Down Expand Up @@ -1102,12 +1102,12 @@ tegra_dma_prep_dma_cyclic(struct dma_chan *dc, dma_addr_t buf_addr, size_t buf_l
size_t period_len, enum dma_transfer_direction direction,
unsigned long flags)
{
enum dma_slave_buswidth slave_bw = DMA_SLAVE_BUSWIDTH_UNDEFINED;
u32 csr, mc_seq, apb_ptr = 0, mmio_seq = 0, burst_size;
unsigned int max_dma_count, len, period_count, i;
struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc);
struct tegra_dma_desc *dma_desc;
struct tegra_dma_sg_req *sg_req;
enum dma_slave_buswidth slave_bw;
u32 csr, mc_seq, apb_ptr = 0, mmio_seq = 0, burst_size;
unsigned int max_dma_count, len, period_count, i;
dma_addr_t mem = buf_addr;
int ret;

Expand Down

0 comments on commit 39b930b

Please sign in to comment.