DMA Engine development
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: dmaengine@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>,
	Green Wan <green.wan@sifive.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] dmaengine: sf-pdma: Reduce scope for the variable “vd” in sf_pdma_desc_residue()
Date: Thu, 10 Dec 2020 14:51:29 +0530	[thread overview]
Message-ID: <20201210092129.GO8403@vkoul-mobl> (raw)
In-Reply-To: <8cd695d1-c081-1d95-de7b-9747e9a76de2@web.de>

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

           reply	other threads:[~2020-12-10  9:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <8cd695d1-c081-1d95-de7b-9747e9a76de2@web.de>]

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=20201210092129.GO8403@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=Markus.Elfring@web.de \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=green.wan@sifive.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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