summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/btf.h
diff options
context:
space:
mode:
authorMartin KaFai Lau2018-07-20 07:14:31 +0200
committerDaniel Borkmann2018-07-20 10:25:48 +0200
commit36fc3c8c282c01ad1570bd864de52f128d731b75 (patch)
tree3ae71065624e4b4321f13045b6ad2f16f612792f /include/uapi/linux/btf.h
parenttools/bpftool: Fix segfault case regarding 'pin' arguments (diff)
downloadkernel-qcow2-linux-36fc3c8c282c01ad1570bd864de52f128d731b75.tar.gz
kernel-qcow2-linux-36fc3c8c282c01ad1570bd864de52f128d731b75.tar.xz
kernel-qcow2-linux-36fc3c8c282c01ad1570bd864de52f128d731b75.zip
bpf: btf: Clean up BTF_INT_BITS() in uapi btf.h
This patch shrinks the BTF_INT_BITS() mask. The current btf_int_check_meta() ensures the nr_bits of an integer cannot exceed 64. Hence, it is mostly an uapi cleanup. The actual btf usage (i.e. seq_show()) is also modified to use u8 instead of u16. The verification (e.g. btf_int_check_meta()) path stays as is to deal with invalid BTF situation. Fixes: 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)") Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/uapi/linux/btf.h')
-rw-r--r--include/uapi/linux/btf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/uapi/linux/btf.h b/include/uapi/linux/btf.h
index 0b5ddbe135a4..972265f32871 100644
--- a/include/uapi/linux/btf.h
+++ b/include/uapi/linux/btf.h
@@ -76,7 +76,7 @@ struct btf_type {
*/
#define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24)
#define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16)
-#define BTF_INT_BITS(VAL) ((VAL) & 0x0000ffff)
+#define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)
/* Attributes stored in the BTF_INT_ENCODING */
#define BTF_INT_SIGNED (1 << 0)