Re: [PATCH bpf-next v7 07/11] bpftool: Generate skeleton for global percpu data
From: Leon Hwang
Date: Wed Jun 24 2026 - 22:47:40 EST
On 25/6/26 00:47, Andrii Nakryiko wrote:
> On Tue, Jun 23, 2026 at 9:15 PM Leon Hwang <leon.hwang@xxxxxxxxx> 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
>
>> [...]