提交 7c8121af 编写于 作者: A Andrii Nakryiko 提交者: Daniel Borkmann

libbpf: Remove unnecessary usdt_rel_ip assignments

Coverity detected that usdt_rel_ip is unconditionally overwritten
anyways, so there is no need to unnecessarily initialize it with unused
value. Clean this up.
Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Acked-by: NYonghong Song <yhs@fb.com>
Acked-by: NJiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20220705224818.4026623-4-andrii@kernel.org
上级 c46a1220
...@@ -652,11 +652,9 @@ static int collect_usdt_targets(struct usdt_manager *man, Elf *elf, const char * ...@@ -652,11 +652,9 @@ static int collect_usdt_targets(struct usdt_manager *man, Elf *elf, const char *
* *
* [0] https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation * [0] https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
*/ */
usdt_rel_ip = usdt_abs_ip = note.loc_addr; usdt_abs_ip = note.loc_addr;
if (base_addr) { if (base_addr)
usdt_abs_ip += base_addr - note.base_addr; usdt_abs_ip += base_addr - note.base_addr;
usdt_rel_ip += base_addr - note.base_addr;
}
/* When attaching uprobes (which is what USDTs basically are) /* When attaching uprobes (which is what USDTs basically are)
* kernel expects file offset to be specified, not a relative * kernel expects file offset to be specified, not a relative
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册