Skip to contentSkip to conversation

kho: Remove redundant 0x prefixes

PATCH Superseded Thorsten Blum 2 participants 2 messages Nov 4

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kho: Remove redundant 0x prefixes

The %pa format specifier already includes the 0x prefix. Remove the redundant prefixes to avoid printing 0x0x.

Fixes c609c144b0e8 ("kexec: add KHO parsing support")
---
 kernel/liveupdate/kexec_handover.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/liveupdate/kexec_handover.c +2 -2
index 6f1f55fe3181..5f828eb44f75 100644
@@ -2015,11 +2015,11 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,
 		memblock_add(area->addr, size);
 		err = memblock_mark_kho_noprsrv(area->addr, size);
 		if (err) {
-			pr_warn("failed to mark the bootmem region 0x%pa+0x%pa: %pe",
+			pr_warn("failed to mark the bootmem region %pa+%pa: %pe",
 				&area->addr, &size, ERR_PTR(err));
 			goto unmap_bootmem;
 		}
-		pr_debug("Marked 0x%pa+0x%pa as bootmem", &area->addr, &size);
+		pr_debug("Marked %pa+%pa as bootmem", &area->addr, &size);
 	}
 
 	memblock_reserve(bootmem_phys, bootmem_len);
#1 lore raw
Quoted 5 lines · Thorsten Blum

The %pa format specifier already includes the 0x prefix. Remove the redundant prefixes to avoid printing 0x0x.

Fixes c609c144b0e8 ("kexec: add KHO parsing support")

Hi Thorsten,

The change looks correct, but I see another problem in the same line:

kernel/liveupdate/kexec_handover.c void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len, · line 2019

Quoted 4 lines
kernel/liveupdate/kexec_handover.c +1 -1
 		if (err) {
-			pr_warn("failed to mark the bootmem region 0x%pa+0x%pa: %pe",
+			pr_warn("failed to mark the bootmem region %pa+%pa: %pe",
 				&area->addr, &size, ERR_PTR(err));

'size' is a 'u64', not a phys_addr_t, so the pr_warn will print the wrong on some platforms. Can you change this to use 0x%llx instead, or change the type of the temporary variable to phys_addr_t instead?

Arnd