]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bpf, tcx: Get rid of tcx_link_const
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 23 Oct 2023 18:50:15 +0000 (20:50 +0200)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 23 Oct 2023 22:01:53 +0000 (15:01 -0700)
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>
Link: https://lore.kernel.org/r/20231023185015.21152-1-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
include/net/tcx.h
kernel/bpf/tcx.c

index 264f147953bae97054544b0f79558fd2b7e53dc8..04be9377785d77956c063f900cbee2bbadba0f5e 100644 (file)
@@ -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);
 
index 1338a13a8b64b0dcc0afd37c077a81318c990ddd..2e4885e7781faca4990d6e141ef599caa1d4f834 100644 (file)
@@ -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();