[PATCH] bpf: unify function pointer type of dispatcher

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The __bpf_prog_run() function takes a bpf_dispatcher_fn as its last
argument, which are usually generated by use of the
DEFINE_BPF_DISPATCHER() macro. The last argument of a bpf_dispatcher_fn
is an open coded function pointer. The DEFINE_BPF_DISPATCHER() macro, on the
other hand, has as its last argument a bpf_func_t, rather than an open
coded function pointer. Unify these two signatures by using bpf_func_t
in both places, since it's the same as the open coded function pointer.

Signed-off-by: Jason A. Donenfeld <Jason@xxxxxxxxx>
---
 include/linux/filter.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/filter.h b/include/linux/filter.h
index 527ae1d64e27..25e85cfc28b8 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -569,8 +569,7 @@ DECLARE_STATIC_KEY_FALSE(bpf_stats_enabled_key);
 
 typedef unsigned int (*bpf_dispatcher_fn)(const void *ctx,
 					  const struct bpf_insn *insnsi,
-					  unsigned int (*bpf_func)(const void *,
-								   const struct bpf_insn *));
+					  bpf_func_t bpf_func);
 
 static __always_inline u32 __bpf_prog_run(const struct bpf_prog *prog,
 					  const void *ctx,
-- 
2.37.3




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux