From: Vinod Koul <vkoul@kernel.org>
To: Akhil R <akhilrajeev@nvidia.com>
Cc: devicetree@vger.kernel.org, dmaengine@vger.kernel.org,
jonathanh@nvidia.com, kyarlagadda@nvidia.com,
ldewangan@nvidia.com, linux-kernel@vger.kernel.org,
linux-tegra@vger.kernel.org, p.zabel@pengutronix.de,
rgumasta@nvidia.com, robh+dt@kernel.org,
thierry.reding@gmail.com, nathan@kernel.org,
dan.carpenter@oracle.com
Subject: Re: [PATCH] dmaengine: tegra: Fix uninitialized variable usage
Date: Fri, 22 Apr 2022 12:55:56 +0530 [thread overview]
Message-ID: <YmJYhDmGyrwr7ZYT@matsya> (raw)
In-Reply-To: <20220420132239.27775-1-akhilrajeev@nvidia.com>
On 20-04-22, 18:52, Akhil R wrote:
> Initialize slave_bw and remove unused switch case in
> get_transfer_param()
Two patches please, unused patch can go to next while fix goes to fixes
>
> Fixes: ee17028009d4 ("dmaengine: tegra: Add tegra gpcdma driver")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
> ---
> drivers/dma/tegra186-gpc-dma.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c
> index f12327732041..6b8d34165176 100644
> --- a/drivers/dma/tegra186-gpc-dma.c
> +++ b/drivers/dma/tegra186-gpc-dma.c
> @@ -830,10 +830,6 @@ static int get_transfer_param(struct tegra_dma_channel *tdc,
> *slave_bw = tdc->dma_sconfig.src_addr_width;
> *csr = TEGRA_GPCDMA_CSR_DMA_IO2MEM_FC;
> return 0;
> - case DMA_MEM_TO_MEM:
> - *burst_size = tdc->dma_sconfig.src_addr_width;
> - *csr = TEGRA_GPCDMA_CSR_DMA_MEM2MEM;
> - return 0;
> default:
> dev_err(tdc2dev(tdc), "DMA direction is not supported\n");
> }
> @@ -985,8 +981,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;
> @@ -1103,12 +1099,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;
>
> --
> 2.17.1
--
~Vinod
prev parent reply other threads:[~2022-04-22 7:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 13:22 [PATCH] dmaengine: tegra: Fix uninitialized variable usage Akhil R
2022-04-22 7:25 ` Vinod Koul [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YmJYhDmGyrwr7ZYT@matsya \
--to=vkoul@kernel.org \
--cc=akhilrajeev@nvidia.com \
--cc=dan.carpenter@oracle.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kyarlagadda@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=rgumasta@nvidia.com \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox