🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25665

[PATCH net-next v18 3/6] net: dsa: motorcomm: use GENMASK_U32() for mbus phy_mask

#25665
From: Kyle Switch
Date: Wed, 02 Dec 2026 08:40
32 lines
8637 bytes
mbus->phy_mask is a u32, but the mask was built with GENMASK(), which
has type unsigned long, requiring an explicit (u32) cast to avoid a
truncation warning.

Use GENMASK_U32() instead, which yields a u32 and makes the intended
32-bit width explicit. The cast can then be dropped. GENMASK_U32()
also lets the compiler reject out-of-range masks at build time.

No functional change.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Kyle Switch <kyle.switch@motor-comm.com>
---
 drivers/net/dsa/motorcomm/mdio_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/motorcomm/mdio_bus.c b/drivers/net/dsa/motorcomm/mdio_bus.c
index a06e2cc94a3e..94087c9962cc 100644
--- a/drivers/net/dsa/motorcomm/mdio_bus.c
+++ b/drivers/net/dsa/motorcomm/mdio_bus.c
@@ -173,7 +173,7 @@ int yt921x_mbus_int_init(struct yt921x_priv *priv, struct device_node *mnp)
 		dev_err(dev, "Invalid max_ports: %u\n", max_ports);
 		return -EINVAL;
 	}
-	mbus->phy_mask = (u32)~GENMASK(max_ports - 1, 0);
+	mbus->phy_mask = ~GENMASK_U32(max_ports - 1, 0);
 
 	res = of_mdiobus_register(mbus, mnp);
 	if (res) {
-- 
2.25.1
Technical Details
Message-ID: <20261202084022.3716891-4-kyle.switch@motor-comm.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!feed-us-ny.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375641-linux-kernel-netdev=dewy.ru
References: <20261202084022.3716891-1-kyle.switch@motor-comm.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!feed-us-ny.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375641-linux-kernel-netdev=dewy.ru
From: kyle.switch@motor-comm.com (Kyle Switch)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v18 3/6] net: dsa: motorcomm: use GENMASK_U32() for mbus phy_mask
Date: Wed,  2 Dec 2026 16:40:19 +0800
Organization: Usenet Network
Message-ID: <20261202084022.3716891-4-kyle.switch@motor-comm.com>
References: <20261202084022.3716891-1-kyle.switch@motor-comm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1925239"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CFYWL7ef9vPufrz0OqT2YEc6iFk= sha256:qzrRyg6ShOezu6qTrWfsbkkfcYluAZ9nSsdfRMXr2Oo=
	sha1:iADrDWq4cy1fsTwIOJo36oIJeF0= sha256:+txRSGLeBiBx2Yndr2Y1Z8AlMK0KCaSdVTaGs8FxwB8=
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 CD76E1175AC; Wed,  2 Dec 2026 11:41:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=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, UNPARSEABLE_RELAY=0.001]
	autolearn=ham autolearn_force=no
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 kJ29Ogeasff4;
	Wed,  2 Dec 2026 11:41:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375641-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=motor-comm.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id EA1CF1175A8; Wed,  2 Dec 2026 11:41:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id B75EA2F13D; Wed,  2 Dec 2026 08:40:55 +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=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796200843;
	b=qC0gDAD5DfqTrKabSG8u2N+uMy55MXFrf853PqYOMBadxE9Z8NpwJFg6L6rQVyxzxErg
	 rZtvbJnvfn+C/u0xOu7BbtrgQDkCJr3xRzBD2oL1N9XF2Rq91vTVvAvNe+zVnJXAGeGxM
	 TOLF/WzN3+tA0ajqwoZNVdpjwMPOx4gwc2D7ek1B2ufiiBlD3ywoClIunQKIzCr3tP2Hz
	 5pBtBUkQXV/2LMkOGBRYa3pQIJLk46UFj6MBXdWX3FvAfcaKKtLHiilTTdgHhF7H0UinL
	 0na4vcM+h3giTEjaOHt7qQAVYmnxNKRGLoneF6IuM5W4fpDZI3qoH7ocFTKOsTg3UeA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796200843;
	h=X-Original-To:Received:DMARC-Filter:X-Alimail-AntiSpam:Received:From:
	 To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=GKai6i3oDHKuAXiJAqwF1goWa4PoEyRgGdbyqYVbiyQ=;
	b=eO/0NMgkM49xB7wW+KcCD4tOuDrjduAFp/HOgEBo/B2vvpgmGnduMTaeORn5kcHexQu0
	 vcJkQUoa2mRSMD1LagH2gqShlLFbYu9XgQ8CMVCfdaHwieNA4+6V6+BQ2Ih0QcE+Abz2P
	 RAOhEPicKUgRgyWv30jGJEeqC1eL4NGEwt7oQnKIi0Vfs9s6npw2C01/aEV34Np9P6y1S
	 QWha6IPdS/zeDHjgKcr8KBSTFjZORME26X/uQzuKbt1R7uozV9+QCOU4TOfEx4vVoWmAP
	 3uBGAHJL7e64qJvh9WQvB32tdJyisTeMUla+hwj+QytX0TAAESyuvZ0Z7P/PJQ5wypw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=pass header.from=motor-comm.com;
	spf=pass smtp.mailfrom=motor-comm.com;
	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 37ED160A2617;
	Wed,  2 Dec 2026 08:40:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.149
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796200842;
	b=1p3xyc9Y8whj65RSrpsN1W+7o+W9OH2uOxEZCnVvVyUd/7XjIvEWS5DXc7E5UvYsthNV
	 p98S3bzGAe/PPdlkf1phBjkazpT3n4jsBHZHdlh+t2uEimqzClPW3WDr4zqxPuVHJg5+v
	 7RBn/3y7meR2NTwv9jwNgBc2gA73hKOwIpk3UBN/o/9B364AIGs3J1vWLYq+XGom+RBiJ
	 xOxi0BiZ4euwYNYX5GIKVn3PKLMgJgUDJL4cCE8s7LBNBG29+gLhMfZiUJZzgXreicN3j
	 OqJlJEn8KziK6DE+BLX/+vR1yFAVgYhRVgLY2bKD5V7w/zybmudN/A+uYJHU9QuOCuA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796200842;
	h=DMARC-Filter:X-Alimail-AntiSpam:Received:From:To:Cc:Subject:Date:
	 Message-Id:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=GKai6i3oDHKuAXiJAqwF1goWa4PoEyRgGdbyqYVbiyQ=;
	b=LVlSPIgI4tGMnzVaCAz6wyBpRpynerAM/6ImO38XbciUAfldMt9qwwTX9Qq1AcTFVBHy
	 qjQRWfcVUiE+GXuBsbiJVaoBq+e5gY5BKfXtEFv7nZrUqeJEl6L63a0IPkL5u7qNnxpcu
	 GX/mFFh7Zn689sHH2yRQznYaLriV8dT3cmgymQlrH4rf95e6rWVIKc+A3Xc4pu3ac3n8T
	 atQVZSkHKyY+8DfdEJz98LDn+eYLZZ4iBQJynpChgK20L+W+Z6lFRKt9WCchnHlDVJrp3
	 NRypEGN9fmXj57f8nQQfM7GCrtY/4DxZWj/d55V80pN8FWUFi4AnWUEhBdwRPic94fw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=motor-comm.com;
	spf=pass smtp.mailfrom=motor-comm.com;
	arc=none smtp.remote-ip=115.124.28.149
X-Received: from out28-149.mail.aliyun.com (out28-149.mail.aliyun.com [115.124.28.149])
	(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 5CAC2606A6B6;
	Wed,  2 Dec 2026 08:40:40 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5CAC2606A6B6
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motor-comm.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=motor-comm.com
X-Alimail-AntiSpam: AC=CONTINUE;BC=0.09469818|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_alarm|0.0182852-0.00122468-0.98049;FP=12206695613431721364|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033032056217;MF=kyle.switch@motor-comm.com;NM=1;PH=DS;RN=20;RT=20;SR=0;TI=SMTPD_---.kEtRdiX_1796200830;
X-Received: from motor-comm.com(mailfrom:kyle.switch@motor-comm.com fp:SMTPD_---.kEtRdiX_1796200830 cluster:ay29)
          by smtp.aliyun-inc.com;
          Wed, 02 Dec 2026 16:40:31 +0800
X-Cc: devicetree@vger.kernel.org,
	krzk+dt@kernel.org,
	conor+dt@kernel.org,
	david.laight.linux@gmail.com,
	ming.xu@motor-comm.com,
	xiaolin.xu@motor-comm.com,
	jianmin.wang@motor-comm.com,
	wei.zhang@gl-inet.com,
	sijia.huang@gl-inet.com
X-Mailer: git-send-email 2.25.1
X-In-Reply-To: <20261202084022.3716891-1-kyle.switch@motor-comm.com>
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