diff mbox series

[iproute2-next,19/20] json_print: Rename print_range() argument

Message ID 20231211140732.11475-20-bpoirier@nvidia.com (mailing list archive)
State Accepted
Delegated to: Stephen Hemminger
Headers show
Series bridge: vni: UI fixes | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Benjamin Poirier Dec. 11, 2023, 2:07 p.m. UTC
The second argument's purpose is better conveyed by calling it "end" rather
than "id" so rename it.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
---
 include/json_print.h |  2 +-
 lib/json_print.c     | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/include/json_print.h b/include/json_print.h
index 86dc5f16..daebcf5d 100644
--- a/include/json_print.h
+++ b/include/json_print.h
@@ -97,7 +97,7 @@  static inline int print_rate(bool use_iec, enum output_type t,
 	return print_color_rate(use_iec, t, COLOR_NONE, key, fmt, rate);
 }
 
-unsigned int print_range(const char *name, __u32 start, __u32 id);
+unsigned int print_range(const char *name, __u32 start, __u32 end);
 
 int print_color_bool_opt(enum output_type type, enum color_attr color,
 			 const char *key, bool value, bool show);
diff --git a/lib/json_print.c b/lib/json_print.c
index f38171ff..7b3b6c3f 100644
--- a/lib/json_print.c
+++ b/lib/json_print.c
@@ -375,16 +375,16 @@  int print_color_rate(bool use_iec, enum output_type type, enum color_attr color,
 	return rc;
 }
 
-unsigned int print_range(const char *name, __u32 start, __u32 id)
+unsigned int print_range(const char *name, __u32 start, __u32 end)
 {
 	int width;
 
 	width = print_uint(PRINT_ANY, name, "%u", start);
-	if (start != id) {
-		char end[64];
+	if (start != end) {
+		char buf[64];
 
-		snprintf(end, sizeof(end), "%sEnd", name);
-		width += print_uint(PRINT_ANY, end, "-%u", id);
+		snprintf(buf, sizeof(buf), "%sEnd", name);
+		width += print_uint(PRINT_ANY, buf, "-%u", end);
 	}
 
 	return width;