summaryrefslogtreecommitdiffstats
path: root/kernel/bpf/arena.c
diff options
context:
space:
mode:
authorHaiyue Wang <haiyue.wang@intel.com>2024-03-27 14:53:29 +0800
committerAlexei Starovoitov <ast@kernel.org>2024-03-28 18:31:36 -0700
commit55fc888ded83ed542f3de3e51bae03936a998349 (patch)
treebb602f9e29f284dcfb6a789e1d99624cb3810fc9 /kernel/bpf/arena.c
parent786bf0e7e2ec90b349a7bab6e97947982ab31f2c (diff)
downloadlinux-stable-55fc888ded83ed542f3de3e51bae03936a998349.tar.gz
linux-stable-55fc888ded83ed542f3de3e51bae03936a998349.tar.bz2
linux-stable-55fc888ded83ed542f3de3e51bae03936a998349.zip
bpf,arena: Use helper sizeof_field in struct accessors
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>
Diffstat (limited to 'kernel/bpf/arena.c')
-rw-r--r--kernel/bpf/arena.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
index 343c3456c8dd..6c81630c5293 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 (SZ_4G + GUARD_SZ)
struct bpf_arena {