libbpf: Fix possible compiler warnings in hashmap
authorNamhyung Kim <namhyung@kernel.org>
Fri, 11 Oct 2024 17:00:21 +0000 (10:00 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 11 Oct 2024 19:36:59 +0000 (12:36 -0700)
commit989a29cfed9b5092c3e18be14e9032c51bb1c9f6
tree8818399908e15c621e83e878f526e93417066c2c
parente6c209da7e0e9aaf955a7b59e91ed78c2b6c96fb
libbpf: Fix possible compiler warnings in hashmap

The hashmap__for_each_entry[_safe] is accessing 'map' as a pointer.
But it does without parentheses so passing a static hash map with an
ampersand (like '&slab_hash') will cause compiler warnings due
to unmatched types as '->' operator has a higher precedence.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20241011170021.1490836-1-namhyung@kernel.org
tools/lib/bpf/hashmap.h