[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251105023925.1447482-1-zeng_chi911@163.com>
Date: Wed, 5 Nov 2025 10:39:25 +0800
From: zeng_chi911@....com
To: akpm@...ux-foundation.org,
surenb@...gle.com,
kent.overstreet@...ux.dev
Cc: linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
zengchi@...inos.cn
Subject: [PATCH] alloc_tag: Use %pe format specifier
From: Zeng Chi <zengchi@...inos.cn>
The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR();
This patch fixes this cocci report:
lib/alloc_tag.c:776:63-70: WARNING: Consider using %pe to print PTR_ERR()
Signed-off-by: Zeng Chi <zengchi@...inos.cn>
---
lib/alloc_tag.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c
index f26456988445..27fee57a5c91 100644
--- a/lib/alloc_tag.c
+++ b/lib/alloc_tag.c
@@ -845,7 +845,7 @@ static int __init alloc_tag_init(void)
alloc_tag_cttype = codetag_register_type(&desc);
if (IS_ERR(alloc_tag_cttype)) {
- pr_err("Allocation tags registration failed, errno = %ld\n", PTR_ERR(alloc_tag_cttype));
+ pr_err("Allocation tags registration failed, errno = %pe\n", alloc_tag_cttype);
free_mod_tags_mem();
shutdown_mem_profiling(true);
return PTR_ERR(alloc_tag_cttype);
--
2.25.1
Powered by blists - more mailing lists