Re: [PATCH bpf-next v2 07/11] selftests/bpf: change NAME_NTH/IS_NAME_NTH for BTF_KIND_TAG format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 13, 2021 at 8:52 AM Yonghong Song <yhs@xxxxxx> wrote:
>
> BTF_KIND_TAG ELF format has a component_idx which might have value -1.
> test_btf may confuse it with common_type.name as NAME_NTH checkes
> high 16bit to be 0xffff. Change NAME_NTH high 16bit check to be
> 0xfffe so it won't confuse with component_idx.
>
> Signed-off-by: Yonghong Song <yhs@xxxxxx>
> ---

Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx>

>  tools/testing/selftests/bpf/prog_tests/btf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/btf.c b/tools/testing/selftests/bpf/prog_tests/btf.c
> index 649f87382c8d..ad39f4d588d0 100644
> --- a/tools/testing/selftests/bpf/prog_tests/btf.c
> +++ b/tools/testing/selftests/bpf/prog_tests/btf.c
> @@ -39,8 +39,8 @@ static bool always_log;
>  #define BTF_END_RAW 0xdeadbeef
>  #define NAME_TBD 0xdeadb33f
>
> -#define NAME_NTH(N) (0xffff0000 | N)
> -#define IS_NAME_NTH(X) ((X & 0xffff0000) == 0xffff0000)
> +#define NAME_NTH(N) (0xfffe0000 | N)
> +#define IS_NAME_NTH(X) ((X & 0xffff0000) == 0xfffe0000)
>  #define GET_NAME_NTH_IDX(X) (X & 0x0000ffff)
>
>  #define MAX_NR_RAW_U32 1024
> --
> 2.30.2
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux