lkml.org 
[lkml]   [2020]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dmaengine: sf-pdma : Reduce scope for the variable “vd ” in sf_pdma_desc_residue()
On 09-12-20, 21:00, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 9 Dec 2020 20:55:05 +0100
>
> A local variable was used only within an else branch.
> Thus move the definition for the variable “vd” into the corresponding
> code block.
>
> This issue was detected by using the Coccinelle software.

And what was the issue detected...?

I feel this is fine and patch below does not add much value..

>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/dma/sf-pdma/sf-pdma.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/dma/sf-pdma/sf-pdma.c b/drivers/dma/sf-pdma/sf-pdma.c
> index c4c4e8575764..c66da79a1b34 100644
> --- a/drivers/dma/sf-pdma/sf-pdma.c
> +++ b/drivers/dma/sf-pdma/sf-pdma.c
> @@ -164,7 +164,6 @@ static void sf_pdma_free_chan_resources(struct dma_chan *dchan)
> static size_t sf_pdma_desc_residue(struct sf_pdma_chan *chan,
> dma_cookie_t cookie)
> {
> - struct virt_dma_desc *vd = NULL;
> struct pdma_regs *regs = &chan->regs;
> unsigned long flags;
> u64 residue = 0;
> @@ -180,7 +179,7 @@ static size_t sf_pdma_desc_residue(struct sf_pdma_chan *chan,
> if (cookie == tx->cookie) {
> residue = readq(regs->residue);
> } else {
> - vd = vchan_find_desc(&chan->vchan, cookie);
> + struct virt_dma_desc *vd = vchan_find_desc(&chan->vchan, cookie);
> if (!vd)
> goto out;
>
> --
> 2.29.2

--
~Vinod

\
 
 \ /
  Last update: 2020-12-10 10:24    [W:0.027 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site