alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses
@ 2021-11-23 10:30 Geert Uytterhoeven
  2021-11-27  1:29 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2021-11-23 10:30 UTC (permalink / raw)
  To: YC Hung, Pierre-Louis Bossart, Liam Girdwood, Ranjani Sridharan,
	Kai Vehmanen, Daniel Baluta, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Matthias Brugger
  Cc: alsa-devel, linux-kernel, Geert Uytterhoeven, linux-mediatek,
	linux-arm-kernel, sound-open-firmware

On 32-bit with CONFIG_ARCH_DMA_ADDR_T_64BIT=n:

    sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘platform_parse_resource’:
    sound/soc/sof/mediatek/mt8195/mt8195.c:51:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=]
       51 |  dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
	  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘adsp_memory_remap_init’:
    sound/soc/sof/mediatek/mt8195/mt8195.c:167:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Werror=format=]
      167 |  dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n", adsp->pa_dram, offset);
	  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘adsp_shared_base_ioremap’:
    sound/soc/sof/mediatek/mt8195/mt8195.c:196:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Werror=format=]
      196 |  dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx,  size=%#x\n",
	  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix the first cases by printing the full resource using %pR.
Fix the other cases by printing the physical addresses using %pa.

Reported-by: noreply@ellerman.id.au
Fixes: 32d7e03d26fd9318 ("ASoC: SOF: mediatek: Add mt8195 hardware support")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 sound/soc/sof/mediatek/mt8195/mt8195.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c
index 40e5a25875a6a93c..b1580b6ac8e19e61 100644
--- a/sound/soc/sof/mediatek/mt8195/mt8195.c
+++ b/sound/soc/sof/mediatek/mt8195/mt8195.c
@@ -48,8 +48,7 @@ static int platform_parse_resource(struct platform_device *pdev, void *data)
 		return ret;
 	}
 
-	dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
-		(phys_addr_t)res.start, resource_size(&res));
+	dev_dbg(dev, "DMA %pR\n", &res);
 
 	ret = of_reserved_mem_device_init(dev);
 	if (ret) {
@@ -164,7 +163,7 @@ static int adsp_memory_remap_init(struct device *dev, struct mtk_adsp_chip_info
 	offset = adsp->pa_dram - DRAM_PHYS_BASE_FROM_DSP_VIEW;
 	adsp->dram_offset = offset;
 	offset >>= DRAM_REMAP_SHIFT;
-	dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n", adsp->pa_dram, offset);
+	dev_dbg(dev, "adsp->pa_dram %pa, offset %#x\n", &adsp->pa_dram, offset);
 	writel(offset, vaddr_emi_map);
 	if (offset != readl(vaddr_emi_map)) {
 		dev_err(dev, "write emi map fail : %#x\n", readl(vaddr_emi_map));
@@ -193,8 +192,8 @@ static int adsp_shared_base_ioremap(struct platform_device *pdev, void *data)
 			return -ENOMEM;
 		}
 	}
-	dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx,  size=%#x\n",
-		adsp->shared_dram, adsp->pa_shared_dram, shared_size);
+	dev_dbg(dev, "shared-dram vbase=%p, phy addr :%pa,  size=%#x\n",
+		adsp->shared_dram, &adsp->pa_shared_dram, shared_size);
 
 	return 0;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses
  2021-11-23 10:30 [PATCH] ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses Geert Uytterhoeven
@ 2021-11-27  1:29 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-11-27  1:29 UTC (permalink / raw)
  To: Jaroslav Kysela, Pierre-Louis Bossart, Kai Vehmanen,
	Takashi Iwai, Ranjani Sridharan, Matthias Brugger,
	Geert Uytterhoeven, YC Hung, Liam Girdwood, Daniel Baluta
  Cc: alsa-devel, linux-mediatek, linux-kernel, linux-arm-kernel,
	sound-open-firmware

On Tue, 23 Nov 2021 11:30:13 +0100, Geert Uytterhoeven wrote:
> On 32-bit with CONFIG_ARCH_DMA_ADDR_T_64BIT=n:
> 
>     sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘platform_parse_resource’:
>     sound/soc/sof/mediatek/mt8195/mt8195.c:51:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=]
>        51 |  dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
> 	  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses
      commit: 4dcddadf5530a0da00e6b2eb8194297b49d33506

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-27  1:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 10:30 [PATCH] ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses Geert Uytterhoeven
2021-11-27  1:29 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).