[PATCH v2 5/5] powercap: intel_rapl: Use %pe to print error pointers symbolically

Rafael J. Wysocki (Intel) rafael at kernel.org
Fri Sep 25 10:29:14 PDT 2026


On Sat, Sep 12, 2026 at 9:13 PM Sumeet Pawnikar <sumeet4linux at gmail.com> wrote:
>
> Replace PTR_ERR() and %ld with %pe and pass the original pointer directly
> to pr_debug(). The %pe format specifier prints a symbolic error name
> (e.g. -ENOMEM) when CONFIG_SYMBOLIC_ERRNAME is enabled, otherwise it falls
> back gracefully and prints the raw integer value. This makes messages more
> readable without any functional change.
>
> Signed-off-by: Sumeet Pawnikar <sumeet4linux at gmail.com>
> ---
>  drivers/powercap/intel_rapl_msr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/powercap/intel_rapl_msr.c b/drivers/powercap/intel_rapl_msr.c
> index a34543e66446..46972ee1ff84 100644
> --- a/drivers/powercap/intel_rapl_msr.c
> +++ b/drivers/powercap/intel_rapl_msr.c
> @@ -582,8 +582,8 @@ static int intel_rapl_msr_init(void)
>         rapl_msr_platdev = platform_device_register_data(NULL, "intel_rapl_msr", 0, def,
>                                                          sizeof(*def));
>         if (IS_ERR(rapl_msr_platdev))
> -               pr_debug("intel_rapl_msr device register failed, ret:%ld\n",
> -                        PTR_ERR(rapl_msr_platdev));
> +               pr_debug("intel_rapl_msr device register failed, ret:%pe\n",
> +                        rapl_msr_platdev);
>
>         return 0;
>  }
> --

Applied as 7.4 material, thanks!



More information about the Linux-mediatek mailing list