Commit 1b773d00 authored by Yuntao Wang's avatar Yuntao Wang Committed by Daniel Borkmann

bpf: Use offsetofend() to simplify macro definition

Use offsetofend() instead of offsetof() + sizeof() to simplify
MIN_BPF_LINEINFO_SIZE macro definition.
Signed-off-by: default avatarYuntao Wang <ytcoode@gmail.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Acked-by: default avatarJoanne Koong <joannelkoong@gmail.com>
Link: https://lore.kernel.org/bpf/20220310161518.534544-1-ytcoode@gmail.com
parent 58617014
...@@ -10400,8 +10400,7 @@ static void adjust_btf_func(struct bpf_verifier_env *env) ...@@ -10400,8 +10400,7 @@ static void adjust_btf_func(struct bpf_verifier_env *env)
aux->func_info[i].insn_off = env->subprog_info[i].start; aux->func_info[i].insn_off = env->subprog_info[i].start;
} }
#define MIN_BPF_LINEINFO_SIZE (offsetof(struct bpf_line_info, line_col) + \ #define MIN_BPF_LINEINFO_SIZE offsetofend(struct bpf_line_info, line_col)
sizeof(((struct bpf_line_info *)(0))->line_col))
#define MAX_LINEINFO_REC_SIZE MAX_FUNCINFO_REC_SIZE #define MAX_LINEINFO_REC_SIZE MAX_FUNCINFO_REC_SIZE
static int check_btf_line(struct bpf_verifier_env *env, static int check_btf_line(struct bpf_verifier_env *env,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment