Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/bpftool: re-organize newline printing for map listing

Let's move the final newline printing in show_map_close_plain() at
the end of the function because it looks correct and consistent with
prog.c. Also let's do related changes for the line which prints
pinned file name.

Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Prashant Bhole and committed by
Alexei Starovoitov
d459b59e f25377ee

+3 -2
+3 -2
tools/bpf/bpftool/map.c
··· 597 597 } 598 598 close(fd); 599 599 600 - printf("\n"); 601 600 if (!hash_empty(map_table.table)) { 602 601 struct pinned_obj *obj; 603 602 604 603 hash_for_each_possible(map_table.table, obj, hash, info->id) { 605 604 if (obj->id == info->id) 606 - printf("\tpinned %s\n", obj->path); 605 + printf("\n\tpinned %s", obj->path); 607 606 } 608 607 } 608 + 609 + printf("\n"); 609 610 return 0; 610 611 } 611 612