diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2016-09-09 03:45:29 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-10 05:36:04 +0300 |
commit | f035a51536af9802f55d8c79bd87f184ebffb093 (patch) | |
tree | b10ca650031a03f3752a1ea9f7178282e8eb0a75 /net/ax25 | |
parent | 6088b5823b4cb132a838878747384cbfb5ce6646 (diff) | |
download | linux-f035a51536af9802f55d8c79bd87f184ebffb093.tar.xz |
bpf: add BPF_SIZEOF and BPF_FIELD_SIZEOF macros
Add BPF_SIZEOF() and BPF_FIELD_SIZEOF() macros to improve the code a bit
which otherwise often result in overly long bytes_to_bpf_size(sizeof())
and bytes_to_bpf_size(FIELD_SIZEOF()) lines. So place them into a macro
helper instead. Moreover, we currently have a BUILD_BUG_ON(BPF_FIELD_SIZEOF())
check in convert_bpf_extensions(), but we should rather make that generic
as well and add a BUILD_BUG_ON() test in all BPF_SIZEOF()/BPF_FIELD_SIZEOF()
users to detect any rewriter size issues at compile time. Note, there are
currently none, but we want to assert that it stays this way.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ax25')
0 files changed, 0 insertions, 0 deletions