Re: [PATCH v2] libbpf: optimize the redundant code in the bpf_object__init_user_btf_maps() function.

From: Yonghong Song

Date: Tue Oct 28 2025 - 12:24:43 EST




On 10/24/25 1:08 AM, Jianyun Gao wrote:
In the elf_sec_data() function, the input parameter 'scn' will be
evaluated. If it is NULL, then it will directly return NULL. Therefore,
the return value of the elf_sec_data() function already takes into
account the case where the input parameter scn is NULL. Therefore,
subsequently, the code only needs to check whether the return value of
the elf_sec_data() function is NULL.

Signed-off-by: Jianyun Gao <jianyungao89@xxxxxxxxx>

Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>