Skip to content

Commit b63dadd

Browse files
borkmannMartin KaFai Lau
authored and
Martin KaFai Lau
committed
bpf, tcx: Get rid of tcx_link_const
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>
1 parent 69a1917 commit b63dadd

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

include/net/tcx.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,11 @@ static inline struct tcx_entry *tcx_entry(struct bpf_mprog_entry *entry)
3838
return container_of(bundle, struct tcx_entry, bundle);
3939
}
4040

41-
static inline struct tcx_link *tcx_link(struct bpf_link *link)
41+
static inline struct tcx_link *tcx_link(const struct bpf_link *link)
4242
{
4343
return container_of(link, struct tcx_link, link);
4444
}
4545

46-
static inline const struct tcx_link *tcx_link_const(const struct bpf_link *link)
47-
{
48-
return tcx_link((struct bpf_link *)link);
49-
}
50-
5146
void tcx_inc(void);
5247
void tcx_dec(void);
5348

kernel/bpf/tcx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static void tcx_link_dealloc(struct bpf_link *link)
250250

251251
static void tcx_link_fdinfo(const struct bpf_link *link, struct seq_file *seq)
252252
{
253-
const struct tcx_link *tcx = tcx_link_const(link);
253+
const struct tcx_link *tcx = tcx_link(link);
254254
u32 ifindex = 0;
255255

256256
rtnl_lock();
@@ -267,7 +267,7 @@ static void tcx_link_fdinfo(const struct bpf_link *link, struct seq_file *seq)
267267
static int tcx_link_fill_info(const struct bpf_link *link,
268268
struct bpf_link_info *info)
269269
{
270-
const struct tcx_link *tcx = tcx_link_const(link);
270+
const struct tcx_link *tcx = tcx_link(link);
271271
u32 ifindex = 0;
272272

273273
rtnl_lock();

0 commit comments

Comments
 (0)