mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-29 01:04:14 -04:00
dma-coherent: use KiB in DMA allocation logs
Update DMA reserved memory pool allocation log messages to display sizes in KiB instead of MiB. Using MiB caused allocations less than 1 MiB to be logged as 0 MiB due to integer truncation. KiB provides better precision for smaller memory regions specified in the Device Tree. Signed-off-by: Vova Sharaienko <sharaienko@google.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20260629223759.2637162-1-sharaienko@google.com
This commit is contained in:
committed by
Marek Szyprowski
parent
9db11c69fc
commit
dbcc3cd580
@@ -69,8 +69,8 @@ static struct dma_coherent_mem *dma_init_coherent_memory(phys_addr_t phys_addr,
|
||||
kfree(dma_mem);
|
||||
out_unmap_membase:
|
||||
memunmap(mem_base);
|
||||
pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %zd MiB\n",
|
||||
&phys_addr, size / SZ_1M);
|
||||
pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %zu KiB\n",
|
||||
&phys_addr, size / SZ_1K);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
@@ -384,8 +384,8 @@ static int __init rmem_dma_setup(unsigned long node, struct reserved_mem *rmem)
|
||||
}
|
||||
#endif
|
||||
|
||||
pr_info("Reserved memory: created DMA memory pool at %pa, size %ld MiB\n",
|
||||
&rmem->base, (unsigned long)rmem->size / SZ_1M);
|
||||
pr_info("Reserved memory: created DMA memory pool at %pa, size %llu KiB\n",
|
||||
&rmem->base, (unsigned long long)(rmem->size / SZ_1K));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user