From: Yuntao Wang <ytcoode@gmail.com>
Date: Sun, 24 Apr 2022 22:34:20 +0800
Subject: libbpf: Remove unnecessary type cast
Patch-mainline: v5.19-rc1
Git-commit: 003fed595c0f37d0ad112447f5f942654979426c
References: jsc#PED-1377
The link variable is already of type 'struct bpf_link *', casting it to
'struct bpf_link *' is redundant, drop it.
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220424143420.457082-1-ytcoode@gmail.com
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
tools/lib/bpf/libbpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -11270,7 +11270,7 @@ static struct bpf_link *bpf_program__att
return libbpf_err_ptr(pfd);
}
link->fd = pfd;
- return (struct bpf_link *)link;
+ return link;
}
struct bpf_link *bpf_program__attach_trace(const struct bpf_program *prog)