Commit 3197239d authored by Jiong Wang's avatar Jiong Wang Committed by Alexei Starovoitov

tools: bpftool: remove unnecessary 'if' to reduce indentation

It is obvious we could use 'else if' instead of start a new 'if' in the
touched code.
Signed-off-by: default avatarJiong Wang <jiong.wang@netronome.com>
Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent c8745e07
...@@ -777,27 +777,25 @@ static int do_dump(int argc, char **argv) ...@@ -777,27 +777,25 @@ static int do_dump(int argc, char **argv)
if (json_output) if (json_output)
jsonw_null(json_wtr); jsonw_null(json_wtr);
} else { } else if (member_len == &info.jited_prog_len) {
if (member_len == &info.jited_prog_len) { const char *name = NULL;
const char *name = NULL;
if (info.ifindex) {
if (info.ifindex) { name = ifindex_to_bfd_name_ns(info.ifindex,
name = ifindex_to_bfd_name_ns(info.ifindex, info.netns_dev,
info.netns_dev, info.netns_ino);
info.netns_ino); if (!name)
if (!name) goto err_free;
goto err_free;
}
disasm_print_insn(buf, *member_len, opcodes, name);
} else {
kernel_syms_load(&dd);
if (json_output)
dump_xlated_json(&dd, buf, *member_len, opcodes);
else
dump_xlated_plain(&dd, buf, *member_len, opcodes);
kernel_syms_destroy(&dd);
} }
disasm_print_insn(buf, *member_len, opcodes, name);
} else {
kernel_syms_load(&dd);
if (json_output)
dump_xlated_json(&dd, buf, *member_len, opcodes);
else
dump_xlated_plain(&dd, buf, *member_len, opcodes);
kernel_syms_destroy(&dd);
} }
free(buf); free(buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment