Skip to contentSkip to conversation

remoteproc: stm32: fix phys_addr_t format string

PATCH Applied Arnd Bergmann 3 participants 3 messages Apr 21, 2021 – May 31, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: stm32: fix phys_addr_t format string

From: Arnd Bergmann <[email protected]>

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")
---
 drivers/remoteproc/stm32_rproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/stm32_rproc.c +1 -1
index 7353f9e7e7af..32595c950569 100644
@@ -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;
 	}
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw

Hello Arnd,

Quoted 4 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

A phys_addr_t may be wider than an int or pointer:

Quoted 8 lines

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")

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

Thanks for the fix!
Arnaud

Quoted 18 lines
---
 drivers/remoteproc/stm32_rproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/stm32_rproc.c +1 -1
index 7353f9e7e7af..32595c950569 100644
@@ -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;
 	}
#2 lore raw
In reply to Arnd Bergmann
This patch was applied to andersson/remoteproc.git (refs/heads/for-next):

Hello:

This patch was applied to andersson/remoteproc.git (refs/heads/for-next):

Quoted 9 lines · On Wed, 21 Apr 2021 16:00:40 +0200 you wrote:

From: Arnd Bergmann <[email protected]>

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);

[...]

Here is the summary with links:
- remoteproc: stm32: fix phys_addr_t format string

    https://git.kernel.org/andersson/remoteproc/c/3e25e407a1c9

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html