Skip to content

Commit 349daa0

Browse files
rddunlaptorvalds
authored andcommitted
mm: fix memory_hotplug.c printk format warning
PFN_PHYS() is a phys_addr_t, which can be u32 or u64. Fix the build warning when phys_addr_t is u32. mm/memory_hotplug.c: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'unsigned int' [-Wformat]: => 1685:3 mm/memory_hotplug.c: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'unsigned int' [-Wformat]: => 1685:3 Signed-off-by: Randy Dunlap <[email protected]> Reported-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0cdc444 commit 349daa0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

mm/memory_hotplug.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,11 +1690,15 @@ static int is_memblock_offlined_cb(struct memory_block *mem, void *arg)
16901690
{
16911691
int ret = !is_memblock_offlined(mem);
16921692

1693-
if (unlikely(ret))
1693+
if (unlikely(ret)) {
1694+
phys_addr_t beginpa, endpa;
1695+
1696+
beginpa = PFN_PHYS(section_nr_to_pfn(mem->start_section_nr));
1697+
endpa = PFN_PHYS(section_nr_to_pfn(mem->end_section_nr + 1))-1;
16941698
pr_warn("removing memory fails, because memory "
1695-
"[%#010llx-%#010llx] is onlined\n",
1696-
PFN_PHYS(section_nr_to_pfn(mem->start_section_nr)),
1697-
PFN_PHYS(section_nr_to_pfn(mem->end_section_nr + 1))-1);
1699+
"[%pa-%pa] is onlined\n",
1700+
&beginpa, &endpa);
1701+
}
16981702

16991703
return ret;
17001704
}

0 commit comments

Comments
 (0)