[PATCH net-next v3 01/10] net: ieee8021q: print traffic type and queue count with %u

From: Oleksij Rempel

Date: Mon Nov 16 2026 - 14:10:51 EST


Switch the out-of-range diagnostic in ieee8021q_tt_to_tc() from %d to
%u. The traffic class count num_queues is an unsigned int and the
traffic type is an enumeration, so printing them as unsigned matches
their types. The print sits on the range-check error path, which still
rejects a negative traffic type; %u only changes how an out-of-range
value is rendered, not which values are rejected.

Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Reviewed-by: Luiz Angelo Daros de Luca <luizluca@xxxxxxxxx>
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
Reviewed-by: Alvin Šipraga <alvin.sipraga@xxxxxxxxxx>
---
Changes in v3:
- No changes.

Changes in v2:
- Drop the reference to a later patch from the commit message. The diff
is unchanged, so the Reviewed-by tags are kept.
---
net/core/ieee8021q_helpers.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/ieee8021q_helpers.c b/net/core/ieee8021q_helpers.c
index 669b357b73b2d7746e4856afdc8187cbaa4f9a6d..bbacdfff9b4c2ec14779baa79d341527fed1920c 100644
--- a/net/core/ieee8021q_helpers.c
+++ b/net/core/ieee8021q_helpers.c
@@ -99,7 +99,7 @@ static const u8 ieee8021q_1queue_tt_tc_map[] = {
int ieee8021q_tt_to_tc(enum ieee8021q_traffic_type tt, unsigned int num_queues)
{
if (tt < 0 || tt >= IEEE8021Q_TT_MAX) {
- pr_err("Requested Traffic Type (%d) is out of range (%d)\n", tt,
+ pr_err("Requested Traffic Type (%u) is out of range (%u)\n", tt,
IEEE8021Q_TT_MAX);
return -EINVAL;
}
@@ -131,7 +131,7 @@ int ieee8021q_tt_to_tc(enum ieee8021q_traffic_type tt, unsigned int num_queues)
return ieee8021q_1queue_tt_tc_map[tt];
}

- pr_err("Invalid number of queues %d\n", num_queues);
+ pr_err("Invalid number of queues %u\n", num_queues);

return -EINVAL;
}

--
2.47.3