diff mbox series

remoteproc: stm32: fix phys_addr_t format string

Message ID 20210421140053.3727528-1-arnd@kernel.org (mailing list archive)
State New, archived
Headers show
Series remoteproc: stm32: fix phys_addr_t format string | expand

Commit Message

Arnd Bergmann April 21, 2021, 2 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

A phys_addr_t may be wider than an int or pointer:

drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_da_to_pa':
drivers/remoteproc/stm32_rproc.c:583:30: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'phys_addr_t' {aka 'long long unsigned int'} [-Werror=format=]
  583 |                 dev_dbg(dev, "da %llx to pa %#x\n", da, *pa);

Print it by reference using the special %pap format string.

Fixes: 8a471396d21c ("remoteproc: stm32: Move resource table setup to rproc_ops")
igned-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/remoteproc/stm32_rproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnaud POULIQUEN April 22, 2021, 10:22 a.m. UTC | #1
Hello Arnd,

On 4/21/21 4:00 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> A phys_addr_t may be wider than an int or pointer:
> 
> drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_da_to_pa':
> drivers/remoteproc/stm32_rproc.c:583:30: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'phys_addr_t' {aka 'long long unsigned int'} [-Werror=format=]
>   583 |                 dev_dbg(dev, "da %llx to pa %#x\n", da, *pa);
> 
> Print it by reference using the special %pap format string.
> 
> Fixes: 8a471396d21c ("remoteproc: stm32: Move resource table setup to rproc_ops")
> igned-off-by: Arnd Bergmann <arnd@arndb.de>

It seems that the 'S' has disappeared during the copy/past :)
It's strange that no bot has made a report...

Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>

Thanks for the fix!
Arnaud

> ---
>  drivers/remoteproc/stm32_rproc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
> index 7353f9e7e7af..32595c950569 100644
> --- a/drivers/remoteproc/stm32_rproc.c
> +++ b/drivers/remoteproc/stm32_rproc.c
> @@ -580,7 +580,7 @@ static int stm32_rproc_da_to_pa(struct rproc *rproc,
>  			continue;
>  
>  		*pa = da - p_mem->dev_addr + p_mem->bus_addr;
> -		dev_dbg(dev, "da %llx to pa %#x\n", da, *pa);
> +		dev_dbg(dev, "da %llx to pa %pap\n", da, pa);
>  
>  		return 0;
>  	}
>
diff mbox series

Patch

diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index 7353f9e7e7af..32595c950569 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -580,7 +580,7 @@  static int stm32_rproc_da_to_pa(struct rproc *rproc,
 			continue;
 
 		*pa = da - p_mem->dev_addr + p_mem->bus_addr;
-		dev_dbg(dev, "da %llx to pa %#x\n", da, *pa);
+		dev_dbg(dev, "da %llx to pa %pap\n", da, pa);
 
 		return 0;
 	}