Re: [PATCH v5 2/9] irqchip/al-fic: use %pe to print init error

From: Radu Rendec

Date: Mon Oct 12 2026 - 15:11:11 EST


On Sun, 2026-10-11 at 05:04 +0000, Eliav Farber wrote:
> al_fic_init_dt() logs PTR_ERR(fic) with %lu when al_fic_wire_init()
> fails. PTR_ERR() returns a signed long, so printing it with an
> unsigned format specifier turns a negative error code into a large
> positive value, making it harder to read.
>
> Pass fic to %pe directly instead of unwrapping it with PTR_ERR()
> first. %pe accepts the ERR_PTR-encoded pointer itself and prints a
> symbolic error name (e.g. -EINVAL) when one is known, falling back
> to the plain decimal value otherwise.
>
> Signed-off-by: Eliav Farber <farbere@xxxxxxxxxx>
> ---
> v5: new patch.
>
>  drivers/irqchip/irq-al-fic.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/irqchip/irq-al-fic.c b/drivers/irqchip/irq-al-fic.c
> index 35581332b40e..41f7a8390328 100644
> --- a/drivers/irqchip/irq-al-fic.c
> +++ b/drivers/irqchip/irq-al-fic.c
> @@ -258,9 +258,8 @@ static int __init al_fic_init_dt(struct device_node *node,
>          node->name,
>          parent_irq);
>   if (IS_ERR(fic)) {
> - pr_err("%s: fail to initialize irqchip (%lu)\n",
> -        node->name,
> -        PTR_ERR(fic));
> + pr_err("%s: fail to initialize irqchip (%pe)\n",
> +        node->name, fic);
>   ret = PTR_ERR(fic);
>   goto err_irq_dispose;
>   }

Reviewed-by: Radu Rendec <radu@xxxxxxxxxx>