kho: Remove redundant 0x prefixes
Subsystems (3)
PATCH v2 1/1 kho: Remove redundant 0x prefixes
The %pa format specifier already includes the 0x prefix. Remove the redundant prefixes to avoid printing 0x0x.
Use phys_addr_t for size to match the expected type.
---
Changes in v2:
- Use phys_addr_t for size as suggested by Arnd (thanks!)
- v1: https://lore.kernel.org/r/[email protected]/
kernel/liveupdate/kexec_handover.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/liveupdate/kexec_handover.c +3 -3
@@ -2010,16 +2010,16 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,*/ for (int i =0 ; i < bootmem_cnt; i++) {struct kho_bootmem *area = &bootmem[i]; -u64 size = area->size; +phys_addr_t size = area->size;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);
Quoted 7 lines · Thorsten Blum
The %pa format specifier already includes the 0x prefix. Remove the redundant prefixes to avoid printing 0x0x.
Use
phys_addr_tfor size to match the expected type.Fixes c609c144b0e8 ("kexec: add KHO parsing support")Signed-off-by Thorsten Blum <[email protected]>
Pasha Tatashin
maintainerQuoted 13 lines
The %pa format specifier already includes the 0x prefix. Remove the redundant prefixes to avoid printing 0x0x.
Use
phys_addr_tfor size to match the expected type.Fixes c609c144b0e8 ("kexec: add KHO parsing support")Signed-off-by Thorsten Blum <[email protected]>kernel/liveupdate/kexec_handover.c +0
-0
kernel/liveupdate/kexec_handover.c void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len, · line 2013
Quoted 5 lines
kernel/liveupdate/kexec_handover.c +1
-1@@ -2010,16 +2010,16 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,*/ for (int i =0 ; i < bootmem_cnt; i++) {struct kho_bootmem *area = &bootmem[i]; -u64 size = area->size; +phys_addr_t size = area->size;
I am not sure; having a variable size of type phys_addr_t looks strange to me. Furthermore, KHO only works on 64-bit platforms because of how our radix tree is designed, and we do not plan to add support for 32-bit systems.
I would keep u64, or if using %pa for u64 is still an eyesore, use 0x%llx for the size field.
Signature · 1 line
Pasha
Quoted 24 lines · Pasha Tatashin
Quoted 13 lines
The %pa format specifier already includes the 0x prefix. Remove the redundant prefixes to avoid printing 0x0x.
Use
phys_addr_tfor size to match the expected type.Fixes c609c144b0e8 ("kexec: add KHO parsing support")Signed-off-by Thorsten Blum <[email protected]>kernel/liveupdate/kexec_handover.c +0
-0kernel/liveupdate/kexec_handover.c void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len, · line 2013
Quoted 5 lines
kernel/liveupdate/kexec_handover.c +1
-1@@ -2010,16 +2010,16 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,*/ for (int i =0 ; i < bootmem_cnt; i++) {struct kho_bootmem *area = &bootmem[i]; -u64 size = area->size; +phys_addr_t size = area->size;I am not sure; having a variable size of type
phys_addr_tlooks strange to me. Furthermore, KHO only works on 64-bit platforms because of how our radix tree is designed, and we do not plan to add support for 32-bit systems.
Quoted 2 lines
I would keep u64, or if using %pa for u64 is still an eyesore, use 0x%llx for the size field.
area->size is also a phys_addr_t, so using a local variable of the same type makes sense for consistency.
Arnd
Pasha Tatashin
maintainerQuoted 26 lines · Arnd Bergmann
Quoted 24 lines · Pasha Tatashin
Quoted 13 lines
The %pa format specifier already includes the 0x prefix. Remove the redundant prefixes to avoid printing 0x0x.
Use
phys_addr_tfor size to match the expected type.Fixes c609c144b0e8 ("kexec: add KHO parsing support")Signed-off-by Thorsten Blum <[email protected]>kernel/liveupdate/kexec_handover.c +0
-0kernel/liveupdate/kexec_handover.c void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len, · line 2013
Quoted 5 lines
kernel/liveupdate/kexec_handover.c +1
-1@@ -2010,16 +2010,16 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,*/ for (int i =0 ; i < bootmem_cnt; i++) {struct kho_bootmem *area = &bootmem[i]; -u64 size = area->size; +phys_addr_t size = area->size;I am not sure; having a variable size of type
phys_addr_tlooks strange to me. Furthermore, KHO only works on 64-bit platforms because of how our radix tree is designed, and we do not plan to add support for 32-bit systems.
Quoted 5 lines
Quoted 2 lines
I would keep u64, or if using %pa for u64 is still an eyesore, use 0x%llx for the size field.
area->sizeis also aphys_addr_t, so using a local variable of the same type makes sense for consistency.
True, that makes sense.
Thanks,
Pasha
Quoted 2 lines
Arnd
Quoted 1 line · Thorsten Blum
kho: Remove redundant 0x prefixes
Applied, thanks!
https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git/log/?h=fixes
[1/1] kho: Remove redundant 0x prefixes
commit: 3cf66b39f560257e77f422d9fc73525ee2c29275
Best regards,
Signature · 1 line
Pasha