All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...))
@ 2025-07-20 16:47 Yonghong Song
  2025-07-21 23:01 ` Eduard Zingerman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yonghong Song @ 2025-07-20 16:47 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, kernel-team,
	Martin KaFai Lau, kernel test robot

Intel linux test robot reported a warning that ERR_CAST can be used
for error pointer casting instead of more-complicated/rarely-used
ERR_PTR(PTR_ERR(...)) style.

There is no functionality change, but still let us replace two such
instances as it improves consistency and readability.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507201048.bceHy8zX-lkp@intel.com/
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
---
 kernel/bpf/cgroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 72c8b50dca0a..2e1c0eab20c0 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -707,11 +707,11 @@ static struct bpf_prog_list *get_prog_list(struct hlist_head *progs, struct bpf_
 	if (is_link) {
 		anchor_link = bpf_get_anchor_link(flags, id_or_fd);
 		if (IS_ERR(anchor_link))
-			return ERR_PTR(PTR_ERR(anchor_link));
+			return ERR_CAST(anchor_link);
 	} else if (is_id || id_or_fd) {
 		anchor_prog = bpf_get_anchor_prog(flags, id_or_fd);
 		if (IS_ERR(anchor_prog))
-			return ERR_PTR(PTR_ERR(anchor_prog));
+			return ERR_CAST(anchor_prog);
 	}
 
 	if (!anchor_prog && !anchor_link) {
-- 
2.47.1


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

* Re: [PATCH bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...))
  2025-07-20 16:47 [PATCH bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...)) Yonghong Song
@ 2025-07-21 23:01 ` Eduard Zingerman
  2025-07-22  0:40 ` patchwork-bot+netdevbpf
  2025-07-22  4:01 ` John Fastabend
  2 siblings, 0 replies; 4+ messages in thread
From: Eduard Zingerman @ 2025-07-21 23:01 UTC (permalink / raw)
  To: Yonghong Song, bpf
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, kernel-team,
	Martin KaFai Lau, kernel test robot

On Sun, 2025-07-20 at 09:47 -0700, Yonghong Song wrote:
> Intel linux test robot reported a warning that ERR_CAST can be used
> for error pointer casting instead of more-complicated/rarely-used
> ERR_PTR(PTR_ERR(...)) style.
> 
> There is no functionality change, but still let us replace two such
> instances as it improves consistency and readability.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202507201048.bceHy8zX-lkp@intel.com/
> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
> ---

Acked-by: Eduard Zingerman <eddyz87@gmail.com>

[...]

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

* Re: [PATCH bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...))
  2025-07-20 16:47 [PATCH bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...)) Yonghong Song
  2025-07-21 23:01 ` Eduard Zingerman
@ 2025-07-22  0:40 ` patchwork-bot+netdevbpf
  2025-07-22  4:01 ` John Fastabend
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-22  0:40 UTC (permalink / raw)
  To: Yonghong Song; +Cc: bpf, ast, andrii, daniel, kernel-team, martin.lau, lkp

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:

On Sun, 20 Jul 2025 09:47:54 -0700 you wrote:
> Intel linux test robot reported a warning that ERR_CAST can be used
> for error pointer casting instead of more-complicated/rarely-used
> ERR_PTR(PTR_ERR(...)) style.
> 
> There is no functionality change, but still let us replace two such
> instances as it improves consistency and readability.
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...))
    https://git.kernel.org/bpf/bpf-next/c/95993dc3039e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...))
  2025-07-20 16:47 [PATCH bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...)) Yonghong Song
  2025-07-21 23:01 ` Eduard Zingerman
  2025-07-22  0:40 ` patchwork-bot+netdevbpf
@ 2025-07-22  4:01 ` John Fastabend
  2 siblings, 0 replies; 4+ messages in thread
From: John Fastabend @ 2025-07-22  4:01 UTC (permalink / raw)
  To: Yonghong Song
  Cc: bpf, Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	kernel-team, Martin KaFai Lau, kernel test robot

On 2025-07-20 09:47:54, Yonghong Song wrote:
> Intel linux test robot reported a warning that ERR_CAST can be used
> for error pointer casting instead of more-complicated/rarely-used
> ERR_PTR(PTR_ERR(...)) style.
> 
> There is no functionality change, but still let us replace two such
> instances as it improves consistency and readability.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202507201048.bceHy8zX-lkp@intel.com/
> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
> ---
 
Acked-by: John Fastabend <john.fastabend@gmail.com>

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

end of thread, other threads:[~2025-07-22  4:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-20 16:47 [PATCH bpf-next] bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR(...)) Yonghong Song
2025-07-21 23:01 ` Eduard Zingerman
2025-07-22  0:40 ` patchwork-bot+netdevbpf
2025-07-22  4:01 ` John Fastabend

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.