From: Prashant Bhole Date: Wed, 17 Apr 2019 00:22:58 +0000 (+0900) Subject: tools/bpftool: re-organize newline printing for map listing X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d459b59ee0f5ed2fa96e77bbd919e095b1aeceb0;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Quentin Monnet Reviewed-by: Jakub Kicinski Acked-by: Song Liu Signed-off-by: Alexei Starovoitov --- diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 44b192e87708..846d2e5c64b4 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -597,15 +597,16 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info) } close(fd); - printf("\n"); if (!hash_empty(map_table.table)) { struct pinned_obj *obj; hash_for_each_possible(map_table.table, obj, hash, info->id) { if (obj->id == info->id) - printf("\tpinned %s\n", obj->path); + printf("\n\tpinned %s", obj->path); } } + + printf("\n"); return 0; }