On 25/6/26 00:47, Andrii Nakryiko wrote: > On Tue, Jun 23, 2026 at 9:15 PM Leon Hwang <[email protected]> wrote: >> >> Makes sense. >> >> With adding the helper bpf_map_is_skel_data(), will this change looks >> more readable? >> >> >> +static bool bpf_map_is_skel_data(const struct bpf_map *map) >> +{ >> + return bpf_map__is_internal(map) && >> + ((bpf_map__map_flags(map) & BPF_F_MMAPABLE) || >> + bpf_map__type(map) == BPF_MAP_TYPE_PERCPU_ARRAY); > > if (!bpf_map__is_internal(map)) > return false; > > return (bpf_map__map_flags(map) & BPF_F_MMAPABLE) || > bpf_map__type(map) == BPF_MAP_TYPE_PERCPU_ARRAY; > > or just split that last return into two if (...) return true); >
Will follow your suggestion, and use two if (...) return true. Thanks, Leon > both work for me > >> [...]

