All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "Vinod Koul" <vkoul@kernel.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Rob Herring" <robh@kernel.org>,
	"Zhang Jianhua" <chris.zjh@huawei.com>,
	dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] dmaengine: owl: fix register access functions
Date: Fri, 22 Mar 2024 20:02:11 +0530	[thread overview]
Message-ID: <20240322143211.GA3333@thinkpad> (raw)
In-Reply-To: <20240322132116.906475-1-arnd@kernel.org>

On Fri, Mar 22, 2024 at 02:21:07PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.de>

Cc: stable@vger.kernel.org # 4.19

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.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
> 

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

WARNING: multiple messages have this Message-ID (diff)
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "Vinod Koul" <vkoul@kernel.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Rob Herring" <robh@kernel.org>,
	"Zhang Jianhua" <chris.zjh@huawei.com>,
	dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] dmaengine: owl: fix register access functions
Date: Fri, 22 Mar 2024 20:02:11 +0530	[thread overview]
Message-ID: <20240322143211.GA3333@thinkpad> (raw)
In-Reply-To: <20240322132116.906475-1-arnd@kernel.org>

On Fri, Mar 22, 2024 at 02:21:07PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.de>

Cc: stable@vger.kernel.org # 4.19

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.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
> 

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2024-03-22 14:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 13:21 [PATCH] dmaengine: owl: fix register access functions Arnd Bergmann
2024-03-22 13:21 ` Arnd Bergmann
2024-03-22 13:36 ` Peter Korsgaard
2024-03-22 13:36   ` Peter Korsgaard
2024-03-22 14:32 ` Manivannan Sadhasivam [this message]
2024-03-22 14:32   ` Manivannan Sadhasivam
2024-03-28  7:39 ` Vinod Koul
2024-03-28  7:39   ` Vinod Koul

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=20240322143211.GA3333@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=afaerber@suse.de \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=chris.zjh@huawei.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=justinstitt@google.com \
    --cc=linux-actions@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=rdunlap@infradead.org \
    --cc=robh@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vkoul@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 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.