Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

liveupdate: kho: use %pe format specifier for error pointer printing

Make pr_xxx() call to use the %pe format specifier instead of %d. The %pe
specifier prints a symbolic error string (e.g., -ENOMEM, -EINVAL) when
given an error pointer created with ERR_PTR(err).

This change enhances the clarity and diagnostic value of the error message
by showing a descriptive error name rather than a numeric error code.

Note, that some err are still printed by value, as those errors might come
from libfdt and not regular errnos.

Link: https://lkml.kernel.org/r/20251101142325.1326536-10-pasha.tatashin@soleen.com
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Co-developed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Changyuan Lyu <changyuanl@google.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Zhu Yanjun and committed by
Andrew Morton
8db839ca c332ebd9

+8 -6
+2 -2
kernel/liveupdate/kexec_handover.c
··· 1449 1449 memblock_add(area->addr, size); 1450 1450 err = memblock_mark_kho_scratch(area->addr, size); 1451 1451 if (WARN_ON(err)) { 1452 - pr_warn("failed to mark the scratch region 0x%pa+0x%pa: %d", 1453 - &area->addr, &size, err); 1452 + pr_warn("failed to mark the scratch region 0x%pa+0x%pa: %pe", 1453 + &area->addr, &size, ERR_PTR(err)); 1454 1454 goto out; 1455 1455 } 1456 1456 pr_debug("Marked 0x%pa+0x%pa as scratch", &area->addr, &size);
+6 -4
kernel/liveupdate/kexec_handover_debugfs.c
··· 150 150 err = __kho_debugfs_fdt_add(&dbg->fdt_list, sub_fdt_dir, name, 151 151 phys_to_virt(*fdt_phys)); 152 152 if (err) { 153 - pr_warn("failed to add fdt %s to debugfs: %d\n", name, 154 - err); 153 + pr_warn("failed to add fdt %s to debugfs: %pe\n", name, 154 + ERR_PTR(err)); 155 155 continue; 156 156 } 157 157 } ··· 168 168 * reviving state from KHO and setting up KHO for the next 169 169 * kexec. 170 170 */ 171 - if (err) 172 - pr_err("failed exposing handover FDT in debugfs: %d\n", err); 171 + if (err) { 172 + pr_err("failed exposing handover FDT in debugfs: %pe\n", 173 + ERR_PTR(err)); 174 + } 173 175 } 174 176 175 177 __init int kho_out_debugfs_init(struct kho_debugfs *dbg)