bpf: btf: fix the brackets of BTF_INT_OFFSET()
Subsystems (2)
PATCH v2 1/1 bpf: btf: fix the brackets of BTF_INT_OFFSET()
'VAL' should be protected by the brackets.
v2:
* Squash the fix for Documentation/bpf/btf.rst
--- Documentation/bpf/btf.rst | 2 +- include/uapi/linux/btf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/bpf/btf.rst +1 -1
@@ -131,7 +131,7 @@ The following sections detail encoding of each kind. ``btf_type`` is followed by a ``u32`` with the following bits arrangement:: #define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24) - #define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16) + #define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16) #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff) The ``BTF_INT_ENCODING`` has the following attributes::
include/uapi/linux/btf.h +1 -1
@@ -83,7 +83,7 @@ struct btf_type {* is the 32 bits arrangement: */ #define BTF_INT_ENCODING (VAL ) (((VAL) & 0x0f000000) >> 24) -#define BTF_INT_OFFSET (VAL ) (((VAL & 0x00ff0000)) >> 16) +#define BTF_INT_OFFSET (VAL ) (((VAL) & 0x00ff0000) >> 16)#define BTF_INT_BITS (VAL ) ((VAL) & 0x000000ff)/* Attributes stored in the BTF_INT_ENCODING */
Signature · 1 line
2.21.0
Quoted 11 lines · Gary Lin
'VAL' should be protected by the brackets.
v2:
* Squash the fix forDocumentation/bpf/btf.rstFixes 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)")Signed-off-by Gary Lin <[email protected]>--- Documentation/bpf/btf.rst | 2 +- include/uapi/linux/btf.h | 2 +-
Can you please also sync btf.h into tools/include/uapi/linux/btf.h? But as a separate patch, because otherwise it will cause issues when syncing libbpf into github.com/libbpf/libbpf repo. Thanks!
Quoted 31 lines
2 files changed, 2 insertions(+), 2 deletions(-)Documentation/bpf/btf.rst +1
-1@@ -131,7 +131,7 @@ The following sections detail encoding of each kind. ``btf_type`` is followed by a ``u32`` with the following bits arrangement:: #define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24) - #define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16) + #define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16) #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff) The ``BTF_INT_ENCODING`` has the following attributes::include/uapi/linux/btf.h +1
-2@@ -83,7 +83,7 @@ struct btf_type {* is the 32 bits arrangement: */ #define BTF_INT_ENCODING (VAL ) (((VAL) & 0x0f000000) >> 24) -#define BTF_INT_OFFSET (VAL ) (((VAL & 0x00ff0000)) >> 16) +#define BTF_INT_OFFSET (VAL ) (((VAL) & 0x00ff0000) >> 16)#define BTF_INT_BITS (VAL ) ((VAL) & 0x000000ff)/* Attributes stored in the BTF_INT_ENCODING */ --2.21.0
Quoted 13 lines · Andrii Nakryiko
Quoted 11 lines · Gary Lin
'VAL' should be protected by the brackets.
v2:
* Squash the fix forDocumentation/bpf/btf.rstFixes 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)")Signed-off-by Gary Lin <[email protected]>--- Documentation/bpf/btf.rst | 2 +- include/uapi/linux/btf.h | 2 +-
Quoted 4 lines
Can you please also sync
btf.hintotools/include/uapi/linux/btf.h? But as a separate patch, because otherwise it will cause issues when syncing libbpf into github.com/libbpf/libbpf repo. Thanks!
I didn't notice that btf.h is also in tools/include. Will send another patch to sync the fix.
Thanks,
Gary Lin
Quoted 32 lines
Quoted 31 lines
2 files changed, 2 insertions(+), 2 deletions(-)Documentation/bpf/btf.rst +1
-1@@ -131,7 +131,7 @@ The following sections detail encoding of each kind. ``btf_type`` is followed by a ``u32`` with the following bits arrangement:: #define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24) - #define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16) + #define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16) #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff) The ``BTF_INT_ENCODING`` has the following attributes::include/uapi/linux/btf.h +1
-2@@ -83,7 +83,7 @@ struct btf_type {* is the 32 bits arrangement: */ #define BTF_INT_ENCODING (VAL ) (((VAL) & 0x0f000000) >> 24) -#define BTF_INT_OFFSET (VAL ) (((VAL & 0x00ff0000)) >> 16) +#define BTF_INT_OFFSET (VAL ) (((VAL) & 0x00ff0000) >> 16)#define BTF_INT_BITS (VAL ) ((VAL) & 0x000000ff)/* Attributes stored in the BTF_INT_ENCODING */ --2.21.0