[PATCH net-next v1 1/8] net: ieee8021q: print traffic type and queue count with %u

From: Oleksij Rempel

Date: Fri Oct 02 2026 - 08:03:44 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.

Preparation for the inverse helper added next, which follows the same
convention.

Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
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 669b357b73b2..bbacdfff9b4c 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