]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
dcb: app: move colon printing out of callbacks
authorDaniel Machon <daniel.machon@microchip.com>
Tue, 6 Jun 2023 07:19:38 +0000 (09:19 +0200)
committerDavid Ahern <dsahern@kernel.org>
Fri, 9 Jun 2023 21:43:43 +0000 (15:43 -0600)
In preparation for changing the prototype of dcb_app_print_filtered(),
move the colon printing out of the callbacks, and into
dcb_app_print_filtered().

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Petr Machata <me@pmachata.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
dcb/dcb_app.c

index 644c37d36ffb9116024c212b86871c97eb009a7e..ed7930ae7b37f8cd8e2b7fdef9a05d53ce0072fc 100644 (file)
@@ -405,12 +405,12 @@ static bool dcb_app_is_port(const struct dcb_app *app)
 
 static int dcb_app_print_key_dec(__u16 protocol)
 {
-       return print_uint(PRINT_ANY, NULL, "%u:", protocol);
+       return print_uint(PRINT_ANY, NULL, "%u", protocol);
 }
 
 static int dcb_app_print_key_hex(__u16 protocol)
 {
-       return print_uint(PRINT_ANY, NULL, "%x:", protocol);
+       return print_uint(PRINT_ANY, NULL, "%x", protocol);
 }
 
 static int dcb_app_print_key_dscp(__u16 protocol)
@@ -419,17 +419,17 @@ static int dcb_app_print_key_dscp(__u16 protocol)
 
 
        if (!is_json_context() && name != NULL)
-               return print_string(PRINT_FP, NULL, "%s:", name);
-       return print_uint(PRINT_ANY, NULL, "%u:", protocol);
+               return print_string(PRINT_FP, NULL, "%s", name);
+       return print_uint(PRINT_ANY, NULL, "%u", protocol);
 }
 
 static int dcb_app_print_key_pcp(__u16 protocol)
 {
        /* Print in numerical form, if protocol value is out-of-range */
        if (protocol > DCB_APP_PCP_MAX)
-               return print_uint(PRINT_ANY, NULL, "%u:", protocol);
+               return print_uint(PRINT_ANY, NULL, "%u", protocol);
 
-       return print_string(PRINT_ANY, NULL, "%s:", pcp_names[protocol]);
+       return print_string(PRINT_ANY, NULL, "%s", pcp_names[protocol]);
 }
 
 static void dcb_app_print_filtered(const struct dcb_app_table *tab,
@@ -454,7 +454,7 @@ static void dcb_app_print_filtered(const struct dcb_app_table *tab,
 
                open_json_array(PRINT_JSON, NULL);
                print_key(app->protocol);
-               print_uint(PRINT_ANY, NULL, "%u ", app->priority);
+               print_uint(PRINT_ANY, NULL, ":%u ", app->priority);
                close_json_array(PRINT_JSON, NULL);
        }