* [PATCH bpf-next] bpf, tcx: Get rid of tcx_link_const
@ 2023-10-23 18:50 Daniel Borkmann
2023-10-23 22:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2023-10-23 18:50 UTC (permalink / raw)
To: martin.lau; +Cc: bpf, Daniel Borkmann
Small clean up to get rid of the extra tcx_link_const() and only retain
the tcx_link().
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
include/net/tcx.h | 7 +------
kernel/bpf/tcx.c | 4 ++--
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/include/net/tcx.h b/include/net/tcx.h
index 264f147953ba..04be9377785d 100644
--- a/include/net/tcx.h
+++ b/include/net/tcx.h
@@ -38,16 +38,11 @@ static inline struct tcx_entry *tcx_entry(struct bpf_mprog_entry *entry)
return container_of(bundle, struct tcx_entry, bundle);
}
-static inline struct tcx_link *tcx_link(struct bpf_link *link)
+static inline struct tcx_link *tcx_link(const struct bpf_link *link)
{
return container_of(link, struct tcx_link, link);
}
-static inline const struct tcx_link *tcx_link_const(const struct bpf_link *link)
-{
- return tcx_link((struct bpf_link *)link);
-}
-
void tcx_inc(void);
void tcx_dec(void);
diff --git a/kernel/bpf/tcx.c b/kernel/bpf/tcx.c
index 1338a13a8b64..2e4885e7781f 100644
--- a/kernel/bpf/tcx.c
+++ b/kernel/bpf/tcx.c
@@ -250,7 +250,7 @@ static void tcx_link_dealloc(struct bpf_link *link)
static void tcx_link_fdinfo(const struct bpf_link *link, struct seq_file *seq)
{
- const struct tcx_link *tcx = tcx_link_const(link);
+ const struct tcx_link *tcx = tcx_link(link);
u32 ifindex = 0;
rtnl_lock();
@@ -267,7 +267,7 @@ static void tcx_link_fdinfo(const struct bpf_link *link, struct seq_file *seq)
static int tcx_link_fill_info(const struct bpf_link *link,
struct bpf_link_info *info)
{
- const struct tcx_link *tcx = tcx_link_const(link);
+ const struct tcx_link *tcx = tcx_link(link);
u32 ifindex = 0;
rtnl_lock();
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH bpf-next] bpf, tcx: Get rid of tcx_link_const
2023-10-23 18:50 [PATCH bpf-next] bpf, tcx: Get rid of tcx_link_const Daniel Borkmann
@ 2023-10-23 22:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-23 22:50 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: martin.lau, bpf
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:
On Mon, 23 Oct 2023 20:50:15 +0200 you wrote:
> Small clean up to get rid of the extra tcx_link_const() and only retain
> the tcx_link().
>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> ---
> include/net/tcx.h | 7 +------
> kernel/bpf/tcx.c | 4 ++--
> 2 files changed, 3 insertions(+), 8 deletions(-)
Here is the summary with links:
- [bpf-next] bpf, tcx: Get rid of tcx_link_const
https://git.kernel.org/bpf/bpf-next/c/b63dadd6f975
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] 2+ messages in thread
end of thread, other threads:[~2023-10-23 22:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 18:50 [PATCH bpf-next] bpf, tcx: Get rid of tcx_link_const Daniel Borkmann
2023-10-23 22:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox