aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Machon <daniel.machon@microchip.com>2023-06-06 09:19:37 +0200
committerDavid Ahern <dsahern@kernel.org>2023-06-09 15:43:37 -0600
commit503e150007a1ff1376553a88e6a8b12cbe9ebcd8 (patch)
tree1d738c6aaf43c5b59578d25e8be89f5a2137330d
parent1b276ffad53d3ee087562b5e55aa58c2e3355361 (diff)
downloadiproute2-503e150007a1ff1376553a88e6a8b12cbe9ebcd8.tar.gz
dcb: app: replace occurrences of %d with %u for printing unsigned int
In preparation for changing the prototype of dcb_app_print_filtered(), replace occurrences of %d for printing unsigned integer, with %u as it ought to be. Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Petr Machata <me@pmachata.org> Signed-off-by: David Ahern <dsahern@kernel.org>
-rw-r--r--dcb/dcb_app.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/dcb/dcb_app.c b/dcb/dcb_app.c
index 8073415ad..644c37d36 100644
--- a/dcb/dcb_app.c
+++ b/dcb/dcb_app.c
@@ -405,7 +405,7 @@ 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, "%d:", protocol);
+ return print_uint(PRINT_ANY, NULL, "%u:", protocol);
}
static int dcb_app_print_key_hex(__u16 protocol)
@@ -420,14 +420,14 @@ 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, "%d:", protocol);
+ 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, "%d:", protocol);
+ return print_uint(PRINT_ANY, NULL, "%u:", protocol);
return print_string(PRINT_ANY, NULL, "%s:", pcp_names[protocol]);
}
@@ -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, "%d ", app->priority);
+ print_uint(PRINT_ANY, NULL, "%u ", app->priority);
close_json_array(PRINT_JSON, NULL);
}
@@ -519,7 +519,7 @@ static void dcb_app_print_default_prio(const struct dcb_app_table *tab)
print_string(PRINT_FP, NULL, "default-prio ", NULL);
first = false;
}
- print_uint(PRINT_ANY, NULL, "%d ", tab->apps[i].priority);
+ print_uint(PRINT_ANY, NULL, "%u ", tab->apps[i].priority);
}
if (!first) {
@@ -550,13 +550,13 @@ static int dcb_app_get_table_attr_cb(const struct nlattr *attr, void *data)
if (!dcb_app_attr_type_validate(type)) {
fprintf(stderr,
- "Unknown attribute in DCB_ATTR_IEEE_APP_TABLE: %d\n",
+ "Unknown attribute in DCB_ATTR_IEEE_APP_TABLE: %u\n",
type);
return MNL_CB_OK;
}
if (mnl_attr_get_payload_len(attr) < sizeof(struct dcb_app)) {
fprintf(stderr,
- "%s payload expected to have size %zd, not %d\n",
+ "%s payload expected to have size %zu, not %u\n",
ieee_attrs_app_names[type], sizeof(struct dcb_app),
mnl_attr_get_payload_len(attr));
return MNL_CB_OK;