Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9ddede0 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Greg Kroah-Hartman
Browse files

libbpf: Fix BTF-defined map's __type macro handling of arrays



[ Upstream commit a53ba15d81995868651dd28a85d8045aef3d4e20 ]

Due to a quirky C syntax of declaring pointers to array or function
prototype, existing __type() macro doesn't work with map key/value types
that are array or function prototype. One has to create a typedef first
and use it to specify key/value type for a BPF map.  By using typeof(),
pointer to type is now handled uniformly for all kinds of types. Convert
one of self-tests as a demonstration.

Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191004040211.2434033-1-andriin@fb.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d40471b7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment