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

Alison Schofield <[email protected]> Sat, 1 Aug 2026 10:13:16 -0700
Newsgroups org.kernel.vger.linux-cxl,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>
> ---
> 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

snip