Article View: linux.kernel.netdev
Article #24462Re: [PATCH net-next v17 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers
From: Kyle Switch
Date: Mon, 30 Nov 2026 07:34
Date: Mon, 30 Nov 2026 07:34
70 lines
10635 bytes
10635 bytes
On 11/11/26 07:26, Jakub Kicinski wrote: > This is an AI-generated review of your patch. The human sending this > email has considered the AI review valid, or at least plausible. > --- > net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers > > This patch replaces two GENMASK() uses in the motorcomm DSA driver with > GENMASK_U32(). One is in yt921x_chip_setup_dsa() in chip.c and the other > is in yt921x_mbus_int_init() in mdio_bus.c. It is described as a type > cleanup with no functional change. > >> 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 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. > [Severity: Medium] > Does this description match the diff? The patch doesn't seem to touch > the YT921X_MBUS_CTRL_* masks at all. After this patch they are still > plain GENMASK() in drivers/net/dsa/motorcomm/mdio_bus.h: > > #define YT921X_MBUS_CTRL_PORT_M GENMASK(25, 21) > #define YT921X_MBUS_CTRL_REG_M GENMASK(20, 16) > #define YT921X_MBUS_CTRL_TYPE_M GENMASK(11, 8) /* wild guess */ > #define YT921X_MBUS_CTRL_OP_M GENMASK(3, 2) /* wild guess */ > > They still feed the u32 mask variables in yt921x_intif_read(), > yt921x_intif_write(), yt921x_extif_read() and yt921x_extif_write(), > for example: > > mask = YT921X_MBUS_CTRL_PORT_M | YT921X_MBUS_CTRL_REG_M | > YT921X_MBUS_CTRL_OP_M; > > No later patch in the series converts them either. > > The two lines the patch does change are not MBUS_CTRL masks. In > yt921x_chip_setup_dsa(), the mask written to YT921X_FILTER_UNK_UCAST > and YT921X_FILTER_UNK_MCAST is changed: > > ctrl = GENMASK_U32(10, 0); > > That seems to contradict "Other GENMASK() uses in the driver are > intentionally left untouched". > > The other change is the phy_mask calculation in yt921x_mbus_int_init(): > > mbus->phy_mask = ~GENMASK_U32(max_ports - 1, 0); > > Also, the message refers to "masks assigned to u16 and u32 fields", > but none of the changed lines involve a u16 field. > > Both changed lines give the same values as before, so runtime behaviour > does not change. Only the description is off. > > Could the message be reworded to describe the FILTER_UNK and phy_mask > changes, with the "left untouched" sentence dropped? The other option > is to convert the YT921X_MBUS_CTRL_* masks in mdio_bus.h as the > message says. Okay, You're right, the description doesn't match the actual changes. I'll reword the commit message to describe the FILTER_UNK and phy_mask changes and drop the "left untouched" sentence and the u16/u32 wording. Runtime behaviour is unchanged, so no code change is needed.
Technical Details
Message-ID:
<e230528b-924e-4a31-b6d0-adccd1bf78e5@motor-comm.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373972-linux-kernel-netdev=dewy.ruReferences:
<20261105031442.4164960-4-kyle.switch@motor-comm.com> <20261110232652.2437155-1-kuba@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373972-linux-kernel-netdev=dewy.ru
From: kyle.switch@motor-comm.com (Kyle Switch)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v17 3/5] net: dsa: motorcomm: use fixed-width
GENMASK_U*() helpers
Date: Mon, 30 Nov 2026 15:34:02 +0800
Organization: Usenet Network
Message-ID: <e230528b-924e-4a31-b6d0-adccd1bf78e5@motor-comm.com>
References: <20261105031442.4164960-4-kyle.switch@motor-comm.com>
<20261110232652.2437155-1-kuba@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="1365786"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8fRgSK+GT1/6YxH79EWwQZQZorM= sha256:51PCCgbAsCAP3qm9i30h3MEHzKTaGhPRtd2PrHtIjkM=
sha1:lD+W7zBvxnanbGPR+intcRJwE3w= sha256:2j0ypXUdeY70U6jK9yvk9pSJXXtDoonkop2kNM3n4hs=
Content-Language: en-US
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 57DB2125FC8; Mon, 30 Nov 2026 10:34:26 +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=[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 IwurNPCLbV5o;
Mon, 30 Nov 2026 10:34:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-373972-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 81E45125FC7; Mon, 30 Nov 2026 10:34:20 +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 709E324057; Mon, 30 Nov 2026 07:34:19 +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=1796024059;
b=L8L7VQYhh/lezUhdQFcUhdUbnrd/Asv3OJnFSKRZ79Sf8UvHSC4NuFP2rvW8YpvlVufM
5axeWo3cTThAQUp+sL3jtN5tXygukmbKtyVJ0cOt0yy8Bkann8fkFl9X4/PFu7kF+yaM0
afIPjEceT8V9riplfwZwGVImB7oeY/lzK0RgjoG4LO3IHfXDHvK/GJaCju3uq5cbIvomZ
iwV6fPNss6in3LMh+fpuLiV7eYgHeiqiVmCp10tuVTQVQKKS5YbyzUULZOK7vitjhDEGh
IqurTA6BfX98UDWM7zb7pMJCCHCFSXyVxgAYJk38vUwc50M1BsvTC+PuzBLkXYnMHGQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796024059;
h=X-Original-To:Received:DMARC-Filter:X-Alimail-AntiSpam:Received:
Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
Content-Type:Content-Transfer-Encoding;
bh=REC+UEiVRDYSZxAKbuajAjaEyagTihol/wqC9lR0OXE=;
b=lj/in44K1ZDxE93JphRdqgRcfVcP4CUyRkGFw+T5z6f0MiOpWIzt1AzjsZhRZxjZGTo3
SAmSTH6iEpANMNzGFwQzfH8GafFrJc5Oy3o9OAVNcxAkVZIAP9QF613/KlvcteM5JfVtH
fFW2EZUGN1IITjoSdCalF8jOBT3PQ/m2770cp9NkuFuqqZTocqdcuLeVg68KU9OJCm7F+
KC0YjCwMld6ri7jscaqxhaEhB14SG/b8nh1i/lkU9wxp+Glt6kjayhyfKiqFya2s7ByBV
MhPCnL+US4+25X5WRvCqvYEysWRKel6d9NcvYByP5fhs7gNnafG9KmDadkduaSePHOw==
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 1FC16606A32E;
Mon, 30 Nov 2026 07:34:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.97
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796024058;
b=LnJMBtxcIhZ1uIdvziVoZCcLZJfjahWhiONpWAQm1IpjGQhmsZvqT6qHwYRw4MU0I6Pl
lHy8r/5HcTaBzjQrLiyDrN38ljS8cAw+Vle663VtT3oMThpivlzvhOTZ9mJ5pVNfLTSMr
Wi/uX4kDift20fpZa2jfrkQdi5I9p5JnwILcxb9gcNuJKSfIT6/A3s/BGGEcPJRoweqLn
Zk/04m60xlzG9YVaVHvUUmK7fFmnB0Hxweom5/rhbpjAiCAgRQektkXry2A6OaLGRZqZ9
s/HQRxdWJ9BtBTuNWrbY9ym/YUvpNWM8IPVIDUKLDrCczMM7/vkEOQx1w+CeXLC3bFg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796024058;
h=DMARC-Filter:X-Alimail-AntiSpam:Received:Message-ID:Date:
MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language:
From:In-Reply-To:Content-Type:Content-Transfer-Encoding;
bh=REC+UEiVRDYSZxAKbuajAjaEyagTihol/wqC9lR0OXE=;
b=kUqU/k/Zbiwe4/2jXwrhYesOwN8XxkgeK3VkB1qdL/PvKy9pt5w3vN55P4VdFc76Lrow
xQmpQ/zJTAnBFf+wRt2au/NOB11LuElWan69SYHH6LzzECsY7uSVoW7YC8wAszBgNKOzT
UyzpACKs/1IZQKUifuR5LOOnw67qFo9XeyiAOdkFr/D+EofqJqDl+xArAEUgS6Oeu9RsG
vR+vKMGgQgTBYP9OcIi0s1ynS0U6KVgtE4hoj42Z3hlaGsT3MIrpUe9OojOjqzFzMrFBl
bwma24fsiwjly7tQ5z9x3BiiqhQ2fpj84db7+r/RqOTvlLBjhDgBNqGnzs1NsYC/t4Q==
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.97
X-Received: from out28-97.mail.aliyun.com (out28-97.mail.aliyun.com [115.124.28.97])
(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 01A7B606A31C;
Mon, 30 Nov 2026 07:34:16 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 01A7B606A31C
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.1088535|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0805844-0.00125161-0.918164;FP=11868129548141629312|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam011083012053;MF=kyle.switch@motor-comm.com;NM=1;PH=DS;RN=16;RT=16;SR=0;TI=SMTPD_---.kD55EGT_1796024042;
X-Received: from 10.10.26.192(mailfrom:kyle.switch@motor-comm.com fp:SMTPD_---.kD55EGT_1796024042 cluster:ay29)
by smtp.aliyun-inc.com;
Mon, 30 Nov 2026 15:34:05 +0800
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-User-Agent: Mozilla Thunderbird
X-Cc: andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, mmyangfl@gmail.com,
horms@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, 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-In-Reply-To: <20261110232652.2437155-1-kuba@kernel.org>