linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Use %pe format specifier for error pointers
@ 2026-01-21  3:48 zenghongling
  2026-01-21  6:26 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: zenghongling @ 2026-01-21  3:48 UTC (permalink / raw)
  To: akpm, axelrasmussen, yuanchu, weixugc, hannes, david, mhocko,
	zhengqi.arch, shakeel.butt, lorenzo.stoakes, yosry.ahmed,
	nphamcs, chengming.zhou
  Cc: linux-mm, linux-kernel, zhongling0719, zenghongling

Convert error logging throughout the MM subsystem to use
the %pe format specifier instead of PTR_ERR() with integer
format specifiers.

Found by:
----
./zswap.c:753:20-27: WARNING: Consider using %pe to print PTR_ERR()
./vmscan.c:7504:12-19: WARNING: Consider using %pe to print PTR_ERR()
---

Signed-off-by: zenghongling <zenghongling@kylinos.cn>
---
 mm/vmscan.c | 4 ++--
 mm/zswap.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index b2fc8b626d3d..29ed0b304b5c 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -7500,8 +7500,8 @@ void __meminit kswapd_run(int nid)
 		pgdat->kswapd = kthread_create_on_node(kswapd, pgdat, nid, "kswapd%d", nid);
 		if (IS_ERR(pgdat->kswapd)) {
 			/* failure at boot is fatal */
-			pr_err("Failed to start kswapd on node %d,ret=%ld\n",
-				   nid, PTR_ERR(pgdat->kswapd));
+			pr_err("Failed to start kswapd on node %d, ret=%pe\n",
+				   nid, pgdat->kswapd);
 			BUG_ON(system_state < SYSTEM_RUNNING);
 			pgdat->kswapd = NULL;
 		} else {
diff --git a/mm/zswap.c b/mm/zswap.c
index c1af782e54ec..c35604db32ad 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -749,8 +749,8 @@ static int zswap_cpu_comp_prepare(unsigned int cpu, struct hlist_node *node)
 
 	acomp = crypto_alloc_acomp_node(pool->tfm_name, 0, 0, cpu_to_node(cpu));
 	if (IS_ERR(acomp)) {
-		pr_err("could not alloc crypto acomp %s : %ld\n",
-				pool->tfm_name, PTR_ERR(acomp));
+		pr_err("could not alloc crypto acomp %s : %pe\n",
+				pool->tfm_name, acomp);
 		ret = PTR_ERR(acomp);
 		goto fail;
 	}
-- 
2.25.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: Use %pe format specifier for error pointers
  2026-01-21  3:48 [PATCH] mm: Use %pe format specifier for error pointers zenghongling
@ 2026-01-21  6:26 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2026-01-21  6:26 UTC (permalink / raw)
  To: zenghongling
  Cc: akpm, axelrasmussen, yuanchu, weixugc, hannes, david, mhocko,
	zhengqi.arch, shakeel.butt, lorenzo.stoakes, yosry.ahmed,
	nphamcs, chengming.zhou, linux-mm, linux-kernel, zhongling0719

On Wed, Jan 21, 2026 at 11:48:17AM +0800, zenghongling wrote:
> Convert error logging throughout the MM subsystem to use
> the %pe format specifier instead of PTR_ERR() with integer
> format specifiers.
> 
> Found by:
> ----
> ./zswap.c:753:20-27: WARNING: Consider using %pe to print PTR_ERR()
> ./vmscan.c:7504:12-19: WARNING: Consider using %pe to print PTR_ERR()

Please stop.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-21  6:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-21  3:48 [PATCH] mm: Use %pe format specifier for error pointers zenghongling
2026-01-21  6:26 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox