Re: [PATCH v4] staging: greybus: replace PTR_ERR() with %pe in error messages

From: Dan Carpenter

Date: Thu Oct 15 2026 - 15:57:32 EST


On Thu, Oct 15, 2026 at 02:10:53PM -0400, Julia Lawall wrote:
>
>
> On Thu, 15 Oct 2026, Alex Elder wrote:
>
> > On 10/15/26 3:22 AM, pavankumaryalagada@xxxxxxxxx wrote:
> > > From: Yalagada Pavan Kumar <pavankumaryalagada@xxxxxxxxx>
> > >
> > > Use %pe to print error pointers directly and display their
> > > error names.
> > >
> > > Keep PTR_ERR() calls when the numeric error value is needed
> > > for returning the error code.
> > >
> > > Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada@xxxxxxxxx>
> >
> > In a few places you are *adding* the error value where it was
> > missing (which I think is an improvement). I assume that the
> > return values in this case are negative errnos.
> >
> > It would have been worth mentioning this other type of change
> > in the patch description too. But it's not worth doing a new
> > version for that. I trust you found all the spots, and fixed
> > them this way. This looks good to me.
>
> This Coccinelle semantic patch finds over 3000 opportunities for this
> change in the kernel as a whole. Outside the context of outreachy, I
> wonder if people would be happy to see such changes, since the %pe code
> seems much more informative.
>

I like %pe but it's not universally popular. I've seen people NAK
these patches because it looks weird in their subsystem and I'm
wondering how many error messages their code prints? Surely, any
error message would stand out is weird and undesirable?

regards,
dan carpenter