lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 10 Dec 2020 14:51:29 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Markus Elfring <Markus.Elfring@....de>
Cc:     dmaengine@...r.kernel.org, Dan Williams <dan.j.williams@...el.com>,
        Green Wan <green.wan@...ive.com>,
        LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: Re: [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@...rs.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@...rs.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ