Skip to content

Commit 4dcddad

Browse files
geertubroonie
authored andcommitted
ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses
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: 32d7e03 ("ASoC: SOF: mediatek: Add mt8195 hardware support") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20211123103013.73645-1-geert@linux-m68k.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent a5e0091 commit 4dcddad

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

sound/soc/sof/mediatek/mt8195/mt8195.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ static int platform_parse_resource(struct platform_device *pdev, void *data)
4949
return ret;
5050
}
5151

52-
dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
53-
(phys_addr_t)res.start, resource_size(&res));
52+
dev_dbg(dev, "DMA %pR\n", &res);
5453

5554
ret = of_reserved_mem_device_init(dev);
5655
if (ret) {
@@ -166,7 +165,7 @@ static int adsp_memory_remap_init(struct device *dev, struct mtk_adsp_chip_info
166165
offset = adsp->pa_dram - DRAM_PHYS_BASE_FROM_DSP_VIEW;
167166
adsp->dram_offset = offset;
168167
offset >>= DRAM_REMAP_SHIFT;
169-
dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n", adsp->pa_dram, offset);
168+
dev_dbg(dev, "adsp->pa_dram %pa, offset %#x\n", &adsp->pa_dram, offset);
170169
writel(offset, vaddr_emi_map);
171170
if (offset != readl(vaddr_emi_map)) {
172171
dev_err(dev, "write emi map fail : %#x\n", readl(vaddr_emi_map));
@@ -195,8 +194,8 @@ static int adsp_shared_base_ioremap(struct platform_device *pdev, void *data)
195194
return -ENOMEM;
196195
}
197196
}
198-
dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx, size=%#x\n",
199-
adsp->shared_dram, adsp->pa_shared_dram, shared_size);
197+
dev_dbg(dev, "shared-dram vbase=%p, phy addr :%pa, size=%#x\n",
198+
adsp->shared_dram, &adsp->pa_shared_dram, shared_size);
200199

201200
return 0;
202201
}

0 commit comments

Comments
 (0)