diff options
author | Haiyue Wang <haiyue.wang@intel.com> | 2024-03-27 14:53:29 +0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-03-27 09:26:31 -0700 |
commit | 45a683b2d815c4d775b77e8c8f0ac9e9b65f3f12 (patch) | |
tree | b2b535dae80267fe1e53b0519152fb1f914a2f21 | |
parent | 4c91c5925ac134ddb8035d05a3e2fb686b44757d (diff) | |
download | bpf-next-master.tar.gz |
Use the well defined helper sizeof_field() to calculate the size of a
struct member, instead of doing custom calculations.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Link: https://lore.kernel.org/r/20240327065334.8140-1-haiyue.wang@intel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r-- | kernel/bpf/arena.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c index 86571e760dd613..af5cae640669dd 100644 --- a/kernel/bpf/arena.c +++ b/kernel/bpf/arena.c @@ -37,7 +37,7 @@ */ /* number of bytes addressable by LDX/STX insn with 16-bit 'off' field */ -#define GUARD_SZ (1ull << sizeof(((struct bpf_insn *)0)->off) * 8) +#define GUARD_SZ (1ull << sizeof_field(struct bpf_insn, off) * 8) #define KERN_VM_SZ ((1ull << 32) + GUARD_SZ) struct bpf_arena { |