Commit 135e541a authored by Zeng Chi's avatar Zeng Chi Committed by Andrew Morton
Browse files

lib/alloc_tag: use %pe format specifier

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()

Link: https://lkml.kernel.org/r/20251105023925.1447482-1-zeng_chi911@163.com


Signed-off-by: default avatarZeng Chi <zengchi@kylinos.cn>
Acked-by: default avatarSeongJae Park <sj@kernel.org>
Acked-by: default avatarSuren Baghdasaryan <surenb@google.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 340b5981
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);