Skip to content

Commit 56fa4f6

Browse files
Laurent Pinchartmszyprow
authored andcommitted
mm: cma: Use %pa to print physical addresses
Casting physical addresses to unsigned long and using %lu truncates the values on systems where physical addresses are larger than 32 bits. Use %pa and get rid of the cast instead. Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Michal Nazarewicz <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]>
1 parent 16195dd commit 56fa4f6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mm/cma.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,8 @@ int __init cma_declare_contiguous(phys_addr_t base,
218218
phys_addr_t highmem_start = __pa(high_memory);
219219
int ret = 0;
220220

221-
pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n",
222-
__func__, (unsigned long)size, (unsigned long)base,
223-
(unsigned long)limit, (unsigned long)alignment);
221+
pr_debug("%s(size %pa, base %pa, limit %pa alignment %pa)\n",
222+
__func__, &size, &base, &limit, &alignment);
224223

225224
if (cma_area_count == ARRAY_SIZE(cma_areas)) {
226225
pr_err("Not enough slots for CMA reserved regions!\n");
@@ -258,8 +257,8 @@ int __init cma_declare_contiguous(phys_addr_t base,
258257
*/
259258
if (fixed && base < highmem_start && base + size > highmem_start) {
260259
ret = -EINVAL;
261-
pr_err("Region at %08lx defined on low/high memory boundary (%08lx)\n",
262-
(unsigned long)base, (unsigned long)highmem_start);
260+
pr_err("Region at %pa defined on low/high memory boundary (%pa)\n",
261+
&base, &highmem_start);
263262
goto err;
264263
}
265264

@@ -309,8 +308,8 @@ int __init cma_declare_contiguous(phys_addr_t base,
309308
if (ret)
310309
goto err;
311310

312-
pr_info("Reserved %ld MiB at %08lx\n", (unsigned long)size / SZ_1M,
313-
(unsigned long)base);
311+
pr_info("Reserved %ld MiB at %pa\n", (unsigned long)size / SZ_1M,
312+
&base);
314313
return 0;
315314

316315
err:

0 commit comments

Comments
 (0)