diff mbox series

[iproute2-next,v5,3/7] devlink: do conditional new line print in pr_out_port_handle_end()

Message ID 20231107080607.190414-4-jiri@resnulli.us (mailing list archive)
State Accepted
Commit fb47796cd6069be0075258b03b94bac09571825c
Delegated to: David Ahern
Headers show
Series expose devlink instances relationships | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Jiri Pirko Nov. 7, 2023, 8:06 a.m. UTC
From: Jiri Pirko <jiri@nvidia.com>

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>
---
v2->v3:
- new patch
---
 devlink/devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/devlink/devlink.c b/devlink/devlink.c
index b711e92caaba..90f6f8ff90e2 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -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)