Re: [PATCH] cxl: use %pe to print error pointers

From: shaikh kamaluddin

Date: Mon Aug 03 2026 - 11:47:15 EST


On Sat, Aug 01, 2026 at 10:13:16AM -0700, Alison Schofield wrote:
> On Sat, Aug 01, 2026 at 03:42:17PM +0530, Shaikh Kamaluddin wrote:
> > Make the code printing pointer error values simpler and address the
> > coccinelle warnings:
> >
> > drivers/cxl/core/port.c:939:3-10: WARNING: Consider using %pe to print PTR_ERR()
> > drivers/cxl/core/port.c:1275:25-32: WARNING: Consider using %pe to print PTR_ERR()
> > drivers/cxl/core/port.c:1309:25-32: WARNING: Consider using %pe to print PTR_ERR()
> > drivers/cxl/core/region.c:686:3-10: WARNING: Consider using %pe to print PTR_ERR()
> > drivers/cxl/core/region.c:3778:13-20: WARNING: Consider using %pe to print PTR_ERR()
> >
> > The %pe specifier prints the error symbolically, so a failed dport
> > addition reports -EBUSY rather than -16, which is easier to follow
> > when tracing port and region setup with dynamic debug enabled.
> >
> > The PTR_ERR() uses in return statements are left unchanged.
> >
> > Signed-off-by: Shaikh Kamaluddin <shaikhkamal2012@xxxxxxxxx>
> > ---
> > Tested with cxl config build in x86 Architecture
> ^ Should this say "Compile tested only with cxl ..."
>
>
> Hi Shaikh,
>
> Thanks for the patch. The code changes look perfect.
>
> I'd like you to spin a v2 of this for the commit message and log
> only. No code changes.
>
> Commit message: follow CXL subject line format, start w uppercase.
> ie: "cxl: Use %pe to print error pointers"
>
> Commit log: Can this be reordered so that the code improvement is
> the reason for the patch and coccinelle is only the tool that found
> the sites? We don't change code to address coccinelle warnings, we
> use coccinelle to find code worth improving.
>
> Please take a look at and follow the model in this commit for your v2:
> c69ca4e992e3 ("mm/zswap: use %pe to print error pointers")
>
> It would also be useful for the commit log to note that drivers/cxl
> was completely scanned and that these are the only conversion candidates.
> That documents the cleanup as complete and saves the next person from
> wondering whether additional sites remain.
>
> -- Alison
>
Hi Alison,

Thanks for the review and the helpful suggestions. I've incorporated them into v2.
v2 link: https://lore.kernel.org/all/20260802112029.28767-1-shaikhkamal2012@xxxxxxxxx/

Thanks,
Shaikh
> snip