All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] dmaengine: sf-pdma: Reduce scope for the variable “vd” in sf_pdma_desc_residue()
       [not found] <8cd695d1-c081-1d95-de7b-9747e9a76de2@web.de>
@ 2020-12-10  9:33   ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-12-10  9:21 UTC (permalink / raw)
  To: Markus Elfring; +Cc: dmaengine, Dan Williams, Green Wan, LKML, kernel-janitors

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: sf-pdma: Reduce scope for the variable “vd
@ 2020-12-10  9:33   ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-12-10  9:33 UTC (permalink / raw)
  To: Markus Elfring; +Cc: dmaengine, Dan Williams, Green Wan, LKML, kernel-janitors

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-10  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8cd695d1-c081-1d95-de7b-9747e9a76de2@web.de>
2020-12-10  9:21 ` [PATCH] dmaengine: sf-pdma: Reduce scope for the variable “vd” in sf_pdma_desc_residue() Vinod Koul
2020-12-10  9:33   ` [PATCH] dmaengine: sf-pdma: Reduce scope for the variable “vd Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.