]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
devlink: do conditional new line print in pr_out_port_handle_end()
authorJiri Pirko <jiri@nvidia.com>
Tue, 7 Nov 2023 08:06:03 +0000 (09:06 +0100)
committerDavid Ahern <dsahern@kernel.org>
Sat, 11 Nov 2023 17:31:19 +0000 (17:31 +0000)
Instead of printing out new line unconditionally, use __pr_out_newline()
to print it only when needed avoiding double prints.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
devlink/devlink.c

index b711e92caabac390056e07627cb03c2e586fe483..90f6f8ff90e235f213293b9ad235c8a83957fa1f 100644 (file)
@@ -2976,7 +2976,7 @@ static void pr_out_port_handle_end(struct dl *dl)
        if (dl->json_output)
                close_json_object();
        else
-               pr_out("\n");
+               __pr_out_newline();
 }
 
 static void pr_out_region_chunk_start(struct dl *dl, uint64_t addr)