Article View: linux.kernel.netdev
Article #14296Re: [PATCH net-next v17 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers
From: Jakub Kicinski
Date: Tue, 10 Nov 2026 23:26
Date: Tue, 10 Nov 2026 23:26
61 lines
10321 bytes
10321 bytes
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.
Technical Details
Message-ID:
<20261110232652.2437155-1-kuba@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360722-linux-kernel-netdev=dewy.ruReferences:
<20261105031442.4164960-4-kyle.switch@motor-comm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360722-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v17 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers Date: Tue, 10 Nov 2026 15:26:52 -0800 Organization: Usenet Network Message-ID: <20261110232652.2437155-1-kuba@kernel.org> References: <20261105031442.4164960-4-kyle.switch@motor-comm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="728754"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:jjJYt/q2j8tHAnaWqeudKzQRzVI= sha256:zhQZYkRuVuHNUI2fskb1Oj1nN+hSPwDpgvKFPGBMpeQ= sha1:NDinTnm2wN/i0pGxmMzcMidg0qI= sha256:kGUKEHHPQVkR00rNOhoDri10z3CZ0Zs/xPMV8iZ1SFg= 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 EFB4F113DAD; Wed, 11 Nov 2026 02:27:24 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org 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 asIqY-SAaMtQ; Wed, 11 Nov 2026 02:27:21 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-360722-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 3457A113DA3; Wed, 11 Nov 2026 02:27:12 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id BEBC4644806; Tue, 10 Nov 2026 23:27:01 +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=1794353214; b=OE6BeUIvFyr7WSkHWSkgtfLGDNpiK/Mk0yJXqSw2KjFgk2bJ76Vye/lrd/S3sDuB1XYo 8rcymwXi9R6iRi7SELUE1vV+gd+Y/gLGWxh3iX1JIPliA2v0trxVVAaT0MQic9zIFgxPH Dhu3Tgwr8/otuM5RWTdIwYo07nDRAj8LI7Zgg9n0KmNeIfMpZZ35J7Bc2m+6oLON+VkoW DNe6hnDKty2G4PS4D7Ac4HMLelDqRI1seDg97w3vhBQM/ECN9UjuYHrgAYEL2PDXF5iyL /VZLaTUElyUwpWvJAetsKbzFdhqzr5i3dJ/MYqQtrjqWZmKXyfrs+w+0CGmPRaQZW1w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794353214; h=X-Original-To:Received:Received:DKIM-Signature: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=dkkjz90Suz+xU/M9ypVYo1fqYZs9S1zPBs/lFY8imtM=; b=LFoR8m7w1xO9+XVJNwDFSuaUXV4klgiwQCUEDdm3dFo5zQ3iizwWyn2GRd/OBoK0BnPz 945fZeyGXhteWu/MRtggGkdpZZqN67UAvoHrAZ/qHlsNk4A7u4Dm+AD6p2JJHpokKaUv0 21OmejjHY7qGl9YeyBWVHzBlTmI1Wt41KTMcxuW3tfixAMIGW7oZ8QCVOlroVrQJJF1ak q/8xJFBATn4PB1sh4f422k6xOtW28gDqvWXWbv9/hs8Bll2F8ZiIYJOKKA9tENVDrROJr WG3+nAZz9toKbastnwefPImFMddFWimoj1qc8JrllAEehwgCvdGPg4wUubEJkQb52gg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="SMqYm/0Y"; 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 8839160A2603; Tue, 10 Nov 2026 23:26:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SMqYm/0Y X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794353213; b=pauSTh+o9oE179MUl5HpWBd+h/7WxkvaI0nPL4OOl0EyGH2xK0raZ4KgIboS78Fby/0x AnVa9loWetHmoQdyr28hs4aYfDc1O95BXH79q3r0dBQiEuSPDKD8rfoq2N9ey/uVzVkJC uNssM7KqabBKcXSpOTQP4LIjCi0GkSNiXQWRJPhyc9WCXHp4cszuIpXpWH66yjinODDJw DX4/9fkmo5sI3zCWEEFW2zr9gIRuqYfKhtGa0ogmJ3gbTZCTXwzYDJXtsUBmOinKkNNqF zwCmdkv+m+fm7cMIBY843kqZei9Cs942CD6NMEow1cnCSM89VvpfKNlGEZqe3r8jYJQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794353213; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=dkkjz90Suz+xU/M9ypVYo1fqYZs9S1zPBs/lFY8imtM=; b=hN5XRiQgLBMrkTUomaBwGziNTjXuJyNxV4MK6TOAHn5Ly4qH729mD7upItWO0wyXxxw8 t2i5gSkekN540WWwRmA95Agm5KCqB3+GK2yFPq2pcZr1YXWzmLIHG4IpbZERkGfndphve sXpNebSmMJYQUMQr4LjaMsPJ6rQYJRb1GALqt+bzbgSAZ9eTHduXzVhSzuoOWPo/RUMKD 3qgVQL8fHVex6YFFD9egiJkK4oIU8YkaXZ/ehCMKSKljdntHErlt1TJiX4UECnxOcKRLw Q2rI2PxtjK+ZvxHCRQWfdFPhmT+lXfSevbUlK8c3glJY8uJFwMFlCMjxdTuwSbKymvw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="SMqYm/0Y"; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A77ED606A335; Tue, 10 Nov 2026 23:26:53 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB8E91F0093D; Tue, 10 Nov 2026 23:26:52 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794353213; bh=dkkjz90Suz+xU/M9ypVYo1fqYZs9S1zPBs/lFY8imtM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SMqYm/0YGCG6mtuFtGslnCPPOfgI/ePVXB62hFOdhcunKGY6o8IiU3knvDBUo8JF5 ELBVh5p+Gjh37PPtbJwU6kM7LEVRCjB9hZrJX2rAeXvRSlvR/qvjH52yr+vwqi/PAn K5wn1Byww5lvNZieDSeX1fqipgRp0HqDBkVQTRBWNSvGzNLGG4aKc8La2R70+yYN1f CBpnJ8wa0ibIbLJJ28JBV/uBwhSTv1H5ZH8n0tj+Qp5FLgN25Y/ci0mlIqpq1BTxEB RdVZAteSl9NiF7Lc2+d6WJSvwrxqqw8Wr0gOhdlqcUN5TzMcu22hQ4rgoB5kF4znd9 +QGlWt4t1iLNg== X-Cc: Jakub Kicinski <kuba@kernel.org>, 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-Mailer: git-send-email 2.56.0 X-In-Reply-To: <20261105031442.4164960-4-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