๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17425

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

#17425
From: Oleksij Rempel
Date: Mon, 16 Nov 2026 19:10
48 lines
11967 bytes
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@pengutronix.de>
Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Alvin ล ipraga <alvin.sipraga@analog.com>
---
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
Technical Details
Message-ID: <20261116-rtl8365mb-dcb-ingress-v3-1-657f5fdb4db7@pengutronix.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364663-linux-kernel-netdev=dewy.ru
References: <20261116-rtl8365mb-dcb-ingress-v3-0-657f5fdb4db7@pengutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364663-linux-kernel-netdev=dewy.ru
From: o.rempel@pengutronix.de (Oleksij Rempel)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v3 01/10] net: ieee8021q: print traffic type and
 queue count with %u
Date: Mon, 16 Nov 2026 20:10:12 +0100
Organization: Usenet Network
Message-ID: <20261116-rtl8365mb-dcb-ingress-v3-1-657f5fdb4db7@pengutronix.de>
References: <20261116-rtl8365mb-dcb-ingress-v3-0-657f5fdb4db7@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2146573"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Y5aDXk5BPdWhCWqxiOzE2zVzBeg= sha256:XjE3QMToQJEttj2UcIJUAqkQ9wq8+DmG3vJWQlovCTE=
	sha1:kJU00dd5vdM/5yInFoA6ZITc/Uc= sha256:hllWKaAU5lXMHTeEtras+cw08OQhpVWfPeN8SA2QJR0=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8E9C2114D51; Mon, 16 Nov 2026 22:12:28 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=pengutronix.de
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Upww8Rd2pimQ;
	Mon, 16 Nov 2026 22:12:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364663-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=pengutronix.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 13B66114D49; Mon, 16 Nov 2026 22:12:15 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id E2652340A2; Mon, 16 Nov 2026 19:11:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794856228;
	b=SrR+WyKpp47FQ47l5G7UWhXcyw9USGKBMtoC5f/4WNFSAZxYlDT/1gZSAbbauaim95Pt
	 GPDZkP4rUkgN+E5t3mePDuTtds0Sy3A3sv/Ep0ee7BmeT7ujGUjokKq9SahwF6UcFhncJ
	 HSQXaoMmbVqcHH8az1u6KL2Y9UEZxGV9VJQ2NygrQR5uHtjQDLbBLAc1FCv+2RMSvXCjs
	 cuXa+CBXmU16YD3+MaxnWoTr+9K+pRRwqfSoCIjAkikvfEog/y5+aK9czVdGiBX9zGKh9
	 FC8FfTMpFvZKHkD29abILdNQ7DttlUvxBMSaPXZmhI5FBz1fa19OZ5oZv62I+bO2Vng==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794856228;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received:
	 From:Date:Subject:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Message-Id:References:
	 In-Reply-To:To:Cc:X-Mailer;
	bh=hsDqUAO1D8l6U/LvbpHiSMYZs+O2HqscI6a/blXF0FQ=;
	b=ylJU495JqesNjlsuG8zNqDkI3QPbgyvDPtXs2zLFfSTHfiGaL2fSa7u7/NtxSWo0mnxX
	 VHIlgDYLw/ASxcINQnpPqLRypneXSPfVxZ5GdbnZ7dPQaC7W9+/RZbmmN80EPbaKzgqeN
	 EUUs593TOY800TaNXP29URN1NnedbCPkdsfXgtbPhFBpGQTH+ZDo9LoiAr1oOM3A+kpiZ
	 txVdtA7GzTu7NAxYw/hVTrGnHt9PFOMMUHmRz5mBFBiGKXXRVzTWWHVCMPqLAtWQ2DIcj
	 SkhT4AO6Hl4oGmntYQ+/3A5ryBz7NvZwKSp24LrCfGEraQ9r5Rk9nMaa5ZCMC9ySmlA==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=E0OZtB+N;
	dmarc=none header.from=pengutronix.de;
	spf=pass smtp.mailfrom=pengutronix.de;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id B160E606A8A7;
	Mon, 16 Nov 2026 19:10:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=E0OZtB+N
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794856222;
	b=3gVKbleHkT9L07C4DshTDKGE7bAD/4jx3sHiGRrl332gWYSrZwviig/Lh5i/yLPQV5aa
	 woY/E2txtxSXqG/xuH4Jv8jr9yKvoaluSqYViSPElBt7E7WNBjiLCkQmuyU8xdl4FfpF9
	 LAVhePV2swsMmoDWlvzHUeVHbMrSmKNTLvWdEIWzqItb7wrNqjN03mVCa1jE4uUVDpjQ2
	 0fOY4iezplMfTo5f8TvQIWWdTw0g0y3IBx/pa7roC27WWjnqMSKbcEiL42A5tINrcrCC+
	 v7PFZWEPKEZ8FPFYjnwaWb/YH8tnICOZKLDAqAv1WoNJwVBHrc6nW1WhrdQctZpvXKw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794856222;
	h=DMARC-Filter:Received:DKIM-Signature:Received:From:Date:Subject:
	 MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:
	 References:In-Reply-To:To:Cc:X-Mailer;
	bh=hsDqUAO1D8l6U/LvbpHiSMYZs+O2HqscI6a/blXF0FQ=;
	b=JSy1bHtzx9g4QcF6NjuVIm9ZcQ3TFEjFefuHyPDj6r1qvYx3VbkRyeVRXv5U0gFSwejj
	 8ukN6l6CGPCfiEYz1n0m/ghcJP98X6uumLkYhrv21R/99BhstbbBG4ZKbcl32QAYsykfr
	 O9GUx+adii3XR+fsqhjXqbRdiTwYwEzR3k4YJhdjCn29E9qYXdEcNLEOSq6MAiEKVgyE+
	 kU1F7r38Eh61YUHn1IuRdNZolXNLQgksnwvvv1+ah2Sj8Ok+GLaifriQExSpbM0TySOA8
	 ljEF1cIGD0Zl9kkb9HJmsMR3dnq8nhuFAYiIV1vMl2NW3fOTpnsHD7qHhAAk81Zjrhg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=pengutronix.de;
	spf=pass smtp.mailfrom=pengutronix.de;
	dkim=pass header.d=pengutronix.de header.i=@pengutronix.de header.a=rsa-sha256 header.s=20260414 header.b=E0OZtB+N;
	arc=pass header.oldest-pass=0 smtp.remote-ip=185.203.200.13
X-Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D338C606A329;
	Mon, 16 Nov 2026 19:10:21 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D338C606A329
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de
X-Received: from dude04.red.stw.pengutronix.de (dude04.red.stw.pengutronix.de [IPv6:2a0a:edc0:0:1101:1d::ac])
	(Authenticated sender: relay-from-dude04.red.stw.pengutronix.de)
	by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id C79AC20584B;
	Mon, 16 Nov 2026 20:10:15 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1794856215;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=hsDqUAO1D8l6U/LvbpHiSMYZs+O2HqscI6a/blXF0FQ=;
	b=E0OZtB+Nfvv9uNWiokiKpPEtZcbgJGGpBzGBrp01WR7hn48CPImAORz/4zwOjv6x+HU0Sl
	uZz/T8pl9WE1WKN5eRoqIqfNxxWqeG2zY2FtF1Y1Ulfv6cbo96Ldvm2qD+Lhai6VHlWOLS
	JQMjm3+oVFQCw5Mu1VY4gu1rcnr80R9mLrVYIq4AwunOfGsEWjifTu7OTm12exZDL92Uo0
	2jJEwI8ZxzOagM0KMRVTSd8IeRcuEhXzn4DEPJsBP7fLoC/o0grRlnyUpaiyoY5t6KSSZN
	ARXdMgNl/XJ/DhziMfRE3axB99uJD5v++QIU37K2fVKB3cUJpkCIPtTX6Q8gnA==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de;
	s=20260414; t=1794856215;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=hsDqUAO1D8l6U/LvbpHiSMYZs+O2HqscI6a/blXF0FQ=;
	b=IHQk9jVHAMpYfZQQSPkuTv9qYdXwjkYMH2Me2TNJw3UYLFOlPZ+Y6e/Uzl/P1ZNc3nImUl
	luCvUM6TIO8xVF3SNa3GbkxqNPiZWHhl/1e4XGlub/zZrLj08hv4OxOUfOUcH3JQEnKTLZ
	HfL4+O1yGpeR2kfgXIqZxDXN79pYhIYI0HT4ssEAaURWDcorjKEIX98FyPPzU5dxdkYWIx
	tD/MbQ4GAqxKBlGW9fN0zXilZg9MaSrRpb3dkc/rIcBFfoRvBLZmaX5zEhwXZzHDx1MOw0
	eqmkbwU2IavW/XRAskBySBRcoq7UDLaGdWK/dvaYLIh8C8oKPorALI0dAEStMQ==
X-ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1794856215; a=rsa-sha256;
	cv=none;
	b=K/wwlii2NhJXdQksH5OyH7l39Y+0YKsgOB4MbHlxVJ+qPTgLP8JKXZRKy+zf9g+KfL0BmK
	7D/ioc0FiOCX940vxH3JCX/Wqubbw5jlwHuHXdDyekXImqKensKA1y6TjE7kM/bJRqG8se
	Opg3x8DdAn6iPcz8JHAq58fKtCrKabKj7i2IWL58yczXPQxK9D9YFe/EJZ6k35o/hjaa55
	fIvYTCK2uLPPLeiVfsszHWBZoX1UCsjJpk3+jPOIeL1qoiPxvOSH9lQe1XYQ7TvTIpO/Ux
	25FmNiHJ14m26XtWfwqQWWN9XceyWUDDxf9KXDM4TwzuVV59CeNPNOPyAVr9rA==
X-ARC-Authentication-Results: i=1;
	ORIGINATING;
	auth=pass smtp.auth=relay-from-dude04.red.stw.pengutronix.de smtp.mailfrom=ore@pengutronix.de
X-Received: by dude04.red.stw.pengutronix.de (Postfix, from userid 1058)
	id AB9AB380095; Mon, 16 Nov 2026 20:10:15 +0100 (CET)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261116-rtl8365mb-dcb-ingress-v3-0-657f5fdb4db7@pengutronix.de>
X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 
 kernel@pengutronix.de, Oleksij Rempel <o.rempel@pengutronix.de>
X-Mailer: b4 0.14.2