linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Pasha Tatashin <pasha.tatashin@soleen.com>,
	akpm@linux-foundation.org, brauner@kernel.org, corbet@lwn.net,
	graf@amazon.com, jgg@ziepe.ca, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-mm@kvack.org,
	masahiroy@kernel.org, ojeda@kernel.org, pratyush@kernel.org,
	rdunlap@infradead.org, rppt@kernel.org, tj@kernel.org
Subject: Re: [PATCH v9 9/9] liveupdate: kho: Use %pe format specifier for error pointer printing
Date: Sat, 1 Nov 2025 12:45:59 -0700	[thread overview]
Message-ID: <57bbade3-0707-4045-b39b-2053434b0b7c@linux.dev> (raw)
In-Reply-To: <20251101142325.1326536-10-pasha.tatashin@soleen.com>


在 2025/11/1 7:23, Pasha Tatashin 写道:
> From: Zhu Yanjun <yanjun.zhu@linux.dev>
>
> 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.
>
> 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>

Appreciate your help, Pasha

Yanjun.Zhu

> Reviewed-by: Simon Horman <horms@kernel.org>
> ---
>   kernel/liveupdate/kexec_handover.c         |  4 ++--
>   kernel/liveupdate/kexec_handover_debugfs.c | 10 ++++++----
>   2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
> index be945c133a2f..167c761988d3 100644
> --- a/kernel/liveupdate/kexec_handover.c
> +++ b/kernel/liveupdate/kexec_handover.c
> @@ -1448,8 +1448,8 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,
>   		memblock_add(area->addr, size);
>   		err = memblock_mark_kho_scratch(area->addr, size);
>   		if (WARN_ON(err)) {
> -			pr_warn("failed to mark the scratch region 0x%pa+0x%pa: %d",
> -				&area->addr, &size, err);
> +			pr_warn("failed to mark the scratch region 0x%pa+0x%pa: %pe",
> +				&area->addr, &size, ERR_PTR(err));
>   			goto out;
>   		}
>   		pr_debug("Marked 0x%pa+0x%pa as scratch", &area->addr, &size);
> diff --git a/kernel/liveupdate/kexec_handover_debugfs.c b/kernel/liveupdate/kexec_handover_debugfs.c
> index 46e9e6c0791f..ac739d25094d 100644
> --- a/kernel/liveupdate/kexec_handover_debugfs.c
> +++ b/kernel/liveupdate/kexec_handover_debugfs.c
> @@ -150,8 +150,8 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
>   		err = __kho_debugfs_fdt_add(&dbg->fdt_list, sub_fdt_dir, name,
>   					    phys_to_virt(*fdt_phys));
>   		if (err) {
> -			pr_warn("failed to add fdt %s to debugfs: %d\n", name,
> -				err);
> +			pr_warn("failed to add fdt %s to debugfs: %pe\n", name,
> +				ERR_PTR(err));
>   			continue;
>   		}
>   	}
> @@ -168,8 +168,10 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
>   	 * reviving state from KHO and setting up KHO for the next
>   	 * kexec.
>   	 */
> -	if (err)
> -		pr_err("failed exposing handover FDT in debugfs: %d\n", err);
> +	if (err) {
> +		pr_err("failed exposing handover FDT in debugfs: %pe\n",
> +		       ERR_PTR(err));
> +	}
>   }
>   
>   __init int kho_out_debugfs_init(struct kho_debugfs *dbg)

-- 
Best Regards,
Yanjun.Zhu



  reply	other threads:[~2025-11-01 19:46 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-01 14:23 [PATCH v9 0/9] liveupdate: Rework KHO for in-kernel users Pasha Tatashin
2025-11-01 14:23 ` [PATCH v9 1/9] kho: make debugfs interface optional Pasha Tatashin
2025-11-07  6:03   ` Zhu Yanjun
2025-11-07 12:00     ` Pasha Tatashin
2025-11-07 12:02       ` Pasha Tatashin
2025-11-07 23:35         ` Yanjun.Zhu
2025-11-08 18:13           ` Pasha Tatashin
2025-11-10  0:20             ` Zhu Yanjun
2025-11-10 13:16               ` Pratyush Yadav
2025-11-10 15:26                 ` Pasha Tatashin
2025-11-11  4:11                   ` Zhu Yanjun
2025-11-11 15:26                     ` Pasha Tatashin
2025-11-13  1:41                       ` Yanjun.Zhu
2025-11-13  2:11                         ` Yanjun.Zhu
2025-11-13 19:59                           ` Pasha Tatashin
2025-11-13 20:07                             ` Yanjun.Zhu
2025-11-13 19:55                       ` Yanjun.Zhu
2025-11-13 20:10                         ` Pasha Tatashin
2025-11-13 20:13                           ` Pasha Tatashin
2025-11-13 20:28                             ` Yanjun.Zhu
2025-11-01 14:23 ` [PATCH v9 2/9] kho: drop notifiers Pasha Tatashin
2025-11-06  8:41   ` kernel test robot
2025-11-06 21:46     ` Pasha Tatashin
2025-11-06 22:14       ` Pasha Tatashin
2025-11-01 14:23 ` [PATCH v9 3/9] kho: add interfaces to unpreserve folios, page ranges, and vmalloc Pasha Tatashin
2025-11-03 18:05   ` Pratyush Yadav
2025-11-01 14:23 ` [PATCH v9 4/9] memblock: Unpreserve memory in case of error Pasha Tatashin
2025-11-02  6:51   ` Mike Rapoport
2025-11-05 10:26   ` Pratyush Yadav
2025-11-01 14:23 ` [PATCH v9 5/9] test_kho: " Pasha Tatashin
2025-11-01 14:23 ` [PATCH v9 6/9] kho: don't unpreserve memory during abort Pasha Tatashin
2025-11-05 10:28   ` Pratyush Yadav
2025-11-01 14:23 ` [PATCH v9 7/9] liveupdate: kho: move to kernel/liveupdate Pasha Tatashin
2025-11-06  7:21   ` kernel test robot
2025-11-07 22:23   ` Andrew Morton
2025-11-08 18:01     ` Pasha Tatashin
2025-11-01 14:23 ` [PATCH v9 8/9] MAINTAINERS: update KHO maintainers Pasha Tatashin
2025-11-01 16:36   ` Mike Rapoport
2025-11-01 14:23 ` [PATCH v9 9/9] liveupdate: kho: Use %pe format specifier for error pointer printing Pasha Tatashin
2025-11-01 19:45   ` Zhu Yanjun [this message]
2025-11-02  6:59   ` Mike Rapoport
2025-11-03 12:59   ` Pratyush Yadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57bbade3-0707-4045-b39b-2053434b0b7c@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=corbet@lwn.net \
    --cc=graf@amazon.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=masahiroy@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox