Skip to content

Commit

Permalink
libbpf: remove unnecessary usdt_rel_ip assignments
Browse files Browse the repository at this point in the history
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: Andrii Nakryiko <andrii@kernel.org>
  • Loading branch information
anakryiko authored and Kernel Patches Daemon committed Jul 5, 2022
1 parent 563ee42 commit 94c5aa0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/lib/bpf/usdt.c
Expand Up @@ -652,11 +652,9 @@ static int collect_usdt_targets(struct usdt_manager *man, Elf *elf, const char *
*
* [0] https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
*/
usdt_rel_ip = usdt_abs_ip = note.loc_addr;
if (base_addr) {
usdt_abs_ip = note.loc_addr;
if (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)
* kernel expects file offset to be specified, not a relative
Expand Down

0 comments on commit 94c5aa0

Please sign in to comment.