Article View: linux.kernel.netdev
Article #1833[PATCH net-next v13 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers
From: Kyle Switch
Date: Sun, 11 Oct 2026 02:50
Date: Sun, 11 Oct 2026 02:50
83 lines
7464 bytes
7464 bytes
Some masks assigned to u16 and u32 fields are defined with
GENMASK(),which is an unsigned long constant and wider than
the field type on 64-bit builds. Convert the affected
internal_mask entries in chip.c and the YT921X_MBUS_CTRL_*
masks used by mdio_bus.c to fixed-width helpers.
This is a type cleanup only, with no functional change. Other
GENMASK() uses in the driver are intentionally left untouched.
Signed-off-by: Kyle Switch <kyle.switch@motor-comm.com>
---
drivers/net/dsa/motorcomm/chip.c | 12 ++++++------
drivers/net/dsa/motorcomm/mdio_bus.c | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
index d4c20658216a..ba988e121d68 100644
--- a/drivers/net/dsa/motorcomm/chip.c
+++ b/drivers/net/dsa/motorcomm/chip.c
@@ -36,19 +36,19 @@
static const struct yt921x_info yt921x_infos[] = {
{
"YT9215SC", YT9215_MAJOR, 1, 0,
- GENMASK(4, 0),
+ GENMASK_U16(4, 0),
BIT(9),
BIT(8) | BIT(9),
},
{
"YT9215S", YT9215_MAJOR, 2, 0,
- GENMASK(4, 0),
+ GENMASK_U16(4, 0),
BIT(9),
BIT(8),
},
{
"YT9215RB", YT9215_MAJOR, 3, 0,
- GENMASK(4, 0),
+ GENMASK_U16(4, 0),
BIT(8) | BIT(9),
0,
},
@@ -66,13 +66,13 @@ static const struct yt921x_info yt921x_infos[] = {
},
{
"YT9218N", YT9218_MAJOR, 0, 0,
- GENMASK(7, 0),
+ GENMASK_U16(7, 0),
0,
0,
},
{
"YT9218MB", YT9218_MAJOR, 1, 0,
- GENMASK(7, 0),
+ GENMASK_U16(7, 0),
BIT(8) | BIT(9),
BIT(8) | BIT(9),
},
@@ -3741,7 +3741,7 @@ static int yt921x_chip_setup_dsa(struct yt921x_priv *priv)
if (res)
return res;
- ctrl = GENMASK(10, 0);
+ ctrl = GENMASK_U32(10, 0);
res = yt921x_reg_write(priv, YT921X_FILTER_UNK_UCAST, ctrl);
if (res)
return res;
diff --git a/drivers/net/dsa/motorcomm/mdio_bus.c b/drivers/net/dsa/motorcomm/mdio_bus.c
index 83f0212551ff..3aa1111efaa4 100644
--- a/drivers/net/dsa/motorcomm/mdio_bus.c
+++ b/drivers/net/dsa/motorcomm/mdio_bus.c
@@ -159,7 +159,7 @@ int yt921x_mbus_int_init(struct yt921x_priv *priv, struct device_node *mnp)
mbus->write = yt921x_mbus_int_write;
mbus->parent = dev;
max_ports = priv->series->max_ports;
- mbus->phy_mask = (u32)~GENMASK(max_ports - 1, 0);
+ mbus->phy_mask = ~GENMASK_U32(max_ports - 1, 0);
res = devm_of_mdiobus_register(dev, mbus, mnp);
if (res)
--
2.25.1
Technical Details
Message-ID:
<20261011025043.1859940-4-kyle.switch@motor-comm.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344371-linux-kernel-netdev=dewy.ruReferences:
<20261011025043.1859940-1-kyle.switch@motor-comm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344371-linux-kernel-netdev=dewy.ru
From: kyle.switch@motor-comm.com (Kyle Switch)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v13 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers
Date: Sun, 11 Oct 2026 10:50:41 +0800
Organization: Usenet Network
Message-ID: <20261011025043.1859940-4-kyle.switch@motor-comm.com>
References: <20261011025043.1859940-1-kyle.switch@motor-comm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1456821"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:kW33IvJErEAXvIzGLLXvaHP4Zo8= sha256:t6JsmwNrZt5fBRa21yCmDNaOm3YNFZj9pIytKpjmXGs=
sha1:CfTsK2rzXR5TTQy0PDPlaHlnVWg= sha256:EVso0sRLb/41NmN2sRYZKmuYtOXAVycED+vqdyauMyQ=
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 2528F10F98C; Sun, 11 Oct 2026 05:56:31 +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 quZN2028pZmM;
Sun, 11 Oct 2026 05:56:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-344371-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 C518E10E0FA; Sun, 11 Oct 2026 05:56:22 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by tor.lore.kernel.org (Postfix) with ESMTP id DC2EF2A0C8; Sun, 11 Oct 2026 02:56:18 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id D0FFA2FFF8D;
Sun, 11 Oct 2026 02:56:15 +0000 (UTC)
X-Received: from out28-53.mail.aliyun.com (out28-53.mail.aliyun.com [115.124.28.53])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C6C328690;
Sun, 11 Oct 2026 02:56:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.53
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791687375; cv=none; b=O6yEboicwxWUCLVgATNJU+olag8DljnJ1VUmbaUb+jnAiPyGWJNBVua+iUCkSkQx4IPsMQisB6eRDKeyRenZLvhn8sIkujUkEb7ZFphvn8/XCKPUNstBOWD46VvZ2FiPhFPLR7q3MmI3m15rxBwfuGlwzzcAYoqRhllifrsrB4E=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791687375; c=relaxed/simple;
bh=yW5sHWXX2om1TauqpZkux7z7FQgeW4JCNLuP0AzqY5k=;
h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
MIME-Version; b=e7ebp4md4uwwtnjcrJ7Ti4UGschLw9FktT0l/Iut0c60HUoZrol4tim/z9DkLucb7siJ+odY3i9PqTmr/iXmTBdd7kVl9mCkF5zCTX/F/IrLmhmLy3ocKkkPgWC/sILUMBMWsDD539DPqAeiqOgHLcvcB6URBAbbiITe0WFw+qo=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motor-comm.com; spf=pass smtp.mailfrom=motor-comm.com; arc=none smtp.client-ip=115.124.28.53
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.2343658|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.00928265-0.000186091-0.990531;FP=12062864084650593942|14|2|17|0|-1|-1|-1;HT=maildocker-contentspam033037028158;MF=kyle.switch@motor-comm.com;NM=1;PH=DS;RN=16;RT=16;SR=0;TI=SMTPD_---.jYiPJX7_1791687051;
X-Received: from motor-comm.com(mailfrom:kyle.switch@motor-comm.com fp:SMTPD_---.jYiPJX7_1791687051 cluster:ay29)
by smtp.aliyun-inc.com;
Sun, 11 Oct 2026 10:50:52 +0800
X-Cc: 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: <20261011025043.1859940-1-kyle.switch@motor-comm.com>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>