linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] alloc_tag: Use %pe format specifier
@ 2025-11-05  2:39 zeng_chi911
  2025-11-05  4:47 ` SeongJae Park
  0 siblings, 1 reply; 3+ messages in thread
From: zeng_chi911 @ 2025-11-05  2:39 UTC (permalink / raw)
  To: akpm, surenb, kent.overstreet; +Cc: linux-kernel, linux-mm, zengchi

From: Zeng Chi <zengchi@kylinos.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@kylinos.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



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

* Re: [PATCH] alloc_tag: Use %pe format specifier
  2025-11-05  2:39 [PATCH] alloc_tag: Use %pe format specifier zeng_chi911
@ 2025-11-05  4:47 ` SeongJae Park
  2025-11-06  0:39   ` Suren Baghdasaryan
  0 siblings, 1 reply; 3+ messages in thread
From: SeongJae Park @ 2025-11-05  4:47 UTC (permalink / raw)
  To: zeng_chi911
  Cc: SeongJae Park, akpm, surenb, kent.overstreet, linux-kernel,
	linux-mm, zengchi

On Wed,  5 Nov 2025 10:39:25 +0800 zeng_chi911@163.com wrote:

> From: Zeng Chi <zengchi@kylinos.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@kylinos.cn>

Acked-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

[...]


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

* Re: [PATCH] alloc_tag: Use %pe format specifier
  2025-11-05  4:47 ` SeongJae Park
@ 2025-11-06  0:39   ` Suren Baghdasaryan
  0 siblings, 0 replies; 3+ messages in thread
From: Suren Baghdasaryan @ 2025-11-06  0:39 UTC (permalink / raw)
  To: SeongJae Park
  Cc: zeng_chi911, akpm, kent.overstreet, linux-kernel, linux-mm, zengchi

On Tue, Nov 4, 2025 at 8:47 PM SeongJae Park <sj@kernel.org> wrote:
>
> On Wed,  5 Nov 2025 10:39:25 +0800 zeng_chi911@163.com wrote:
>
> > From: Zeng Chi <zengchi@kylinos.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@kylinos.cn>
>
> Acked-by: SeongJae Park <sj@kernel.org>

Acked-by: Suren Baghdasaryan <surenb@google.com>

>
>
> Thanks,
> SJ
>
> [...]


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

end of thread, other threads:[~2025-11-06  0:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-05  2:39 [PATCH] alloc_tag: Use %pe format specifier zeng_chi911
2025-11-05  4:47 ` SeongJae Park
2025-11-06  0:39   ` Suren Baghdasaryan

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