projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be35f4a
)
libbpf: Remove unnecessary ternary operator
author
Viktor Malik
<vmalik@redhat.com>
Wed, 1 Mar 2023 08:53:53 +0000
(09:53 +0100)
committer
Andrii Nakryiko
<andrii@kernel.org>
Wed, 1 Mar 2023 19:13:10 +0000
(11:13 -0800)
Coverity reports that the first check of 'err' in bpf_object__init_maps
is always false as 'err' is initialized to 0 at that point. Remove the
unnecessary ternary operator.
Signed-off-by: Viktor Malik <vmalik@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link:
https://lore.kernel.org/bpf/78a3702f2ea9f32a84faaae9b674c56269d330a7.1677658777.git.vmalik@redhat.com
tools/lib/bpf/libbpf.c
patch
|
blob
|
history
diff --git
a/tools/lib/bpf/libbpf.c
b/tools/lib/bpf/libbpf.c
index 05c4db355f281bbab1f16e2424c6dd77c5dd8642..905193d988852cab0cf27149be2deb9b2e5d18aa 100644
(file)
--- a/
tools/lib/bpf/libbpf.c
+++ b/
tools/lib/bpf/libbpf.c
@@
-2615,7
+2615,7
@@
static int bpf_object__init_maps(struct bpf_object *obj,
strict = !OPTS_GET(opts, relaxed_maps, false);
pin_root_path = OPTS_GET(opts, pin_root_path, NULL);
- err =
err ?:
bpf_object__init_user_btf_maps(obj, strict, pin_root_path);
+ err = bpf_object__init_user_btf_maps(obj, strict, pin_root_path);
err = err ?: bpf_object__init_global_data_maps(obj);
err = err ?: bpf_object__init_kconfig_map(obj);
err = err ?: bpf_object__init_struct_ops_maps(obj);