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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240322143211.GA3333@thinkpad>
Date: Fri, 22 Mar 2024 20:02:11 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Vinod Koul <vkoul@...nel.org>,
	Andreas Färber <afaerber@...e.de>,
	Nathan Chancellor <nathan@...nel.org>,
	Arnd Bergmann <arnd@...db.de>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>,
	Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
	Randy Dunlap <rdunlap@...radead.org>, Rob Herring <robh@...nel.org>,
	Zhang Jianhua <chris.zjh@...wei.com>, dmaengine@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-actions@...ts.infradead.org, linux-kernel@...r.kernel.org,
	llvm@...ts.linux.dev
Subject: Re: [PATCH] dmaengine: owl: fix register access functions

On Fri, Mar 22, 2024 at 02:21:07PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> When building with 'make W=1', clang notices that the computed register
> values are never actually written back but instead the wrong variable
> is set:
> 
> drivers/dma/owl-dma.c:244:6: error: variable 'regval' set but not used [-Werror,-Wunused-but-set-variable]
>   244 |         u32 regval;
>       |             ^
> drivers/dma/owl-dma.c:268:6: error: variable 'regval' set but not used [-Werror,-Wunused-but-set-variable]
>   268 |         u32 regval;
>       |             ^
> 
> Change these to what was most likely intended.
> 

Wow... Thanks for spotting. Well thanks to Clang also ;)

> Fixes: 47e20577c24d ("dmaengine: Add Actions Semi Owl family S900 DMA driver")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Cc: stable@...r.kernel.org # 4.19

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>

- Mani

> ---
>  drivers/dma/owl-dma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
> index 4e76c4ec2d39..e001f4f7aa64 100644
> --- a/drivers/dma/owl-dma.c
> +++ b/drivers/dma/owl-dma.c
> @@ -250,7 +250,7 @@ static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
>  	else
>  		regval &= ~val;
>  
> -	writel(val, pchan->base + reg);
> +	writel(regval, pchan->base + reg);
>  }
>  
>  static void pchan_writel(struct owl_dma_pchan *pchan, u32 reg, u32 data)
> @@ -274,7 +274,7 @@ static void dma_update(struct owl_dma *od, u32 reg, u32 val, bool state)
>  	else
>  		regval &= ~val;
>  
> -	writel(val, od->base + reg);
> +	writel(regval, od->base + reg);
>  }
>  
>  static void dma_writel(struct owl_dma *od, u32 reg, u32 data)
> -- 
> 2.39.2
> 

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ