From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796035959; b=VwmVC01Hgm/hs8BmrX7KgpwvI+TLP/IuHMxthfni42zdIT71/BwdRLOyerkOPjrM+7S1 EQxxmG1K1q+guhcdfw+5EMh3lXytI3U8275JH8cxKorXhDqSMq72iESAQTTneVGNs0sCD Il61KBJQduFD+/9K8ui5dK0FObQ7MUpPmP2WtoBfahWmbyL0HnszLtDYNDxeK5IX0JQif uZOTr3LJdq7ssl6UFta0QGPMC/TDRP+TfX4t7YYK2fjhiw4w06IDq7vmiiTlFvdje7w0U 8+W8t+VakBiHwP/3+viS2aaRB90HABSpLfCR2tctbaeCyCta/JQBH7aAD+00K1BF1iQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796035959; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=6QQ0DZYuIRw6EZBxd2mk/d5igN6l4XKLz7TJAL7X4f4=; b=tMX5GP3GObeB0caWJyR5ki7ZInaaEQ/W52LspESXsi0DG9xlgtIX6Ek54o+OE+0APCzH W9ZBsLmEs41tufkIKvO1oiDplnpKV48lzN82J4WdDlVmw+oe4nI9HNqGySjNkSnEWqDvK qEF5o/SnZfeLqXKFmGlohbk4x7LV197M31WjsfMNGzF8Pwhj3k1E4OgNGzrsKbhZxPrLV dV9ugtdmLzU8NWLn6eicIf3UxHMTSzRgKLPWC77Sejc1MVyd2q9Bkruyw4nD0CjK42EW+ hRvQ5mKpVI9RmVqqrh+JyiVS8I6my+89epXiQJ1wtey/NcMIVJ8setOrxEyO4iTlVJA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=hsMv1Mel; arc=none smtp.remote-ip=209.85.128.48 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03B98606A31C for ; Mon, 30 Nov 2026 10:52:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 03B98606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=hsMv1Mel Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4bba60271d7so44552125e9.2 for ; Mon, 30 Nov 2026 02:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796035957; x=1796640757; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=6QQ0DZYuIRw6EZBxd2mk/d5igN6l4XKLz7TJAL7X4f4=; b=hsMv1Mel2h25iZAriRhV+y06CVQF77qA84zKuKGTJ20964WJ4gkyR0sEytlDEB70nE zxG9FzB79NStwswDTiBviOq+oIBCbP/qzAucA69yGUpIx8TpZjRgt6Gl1Vd4ovL+qHTR J805rc6Uy582JZYDRXB8FWEUVNvZ3R8Pl303ZFNNJFvsvo6e28J1yYmqAUZeKMm3LQ62 EkbGfSPaZ7p/NLb2FT3g8zhthqOdJxxYdYR/99yNPj8Kw5KDWM+cFU3maK1Y32g3VIVJ cXcQX8QnK0/vXWmQLSHi3eWMnCfCuNp4Pl8kIX5AFbkwhlhoRPUW54KO4lUOr3RDzJmp tS3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796035957; x=1796640757; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6QQ0DZYuIRw6EZBxd2mk/d5igN6l4XKLz7TJAL7X4f4=; b=LpUA7xVNECAeIAURZTEsfdmc1YJPZ1P4wxQDc6CA/fa19Sfc3n30wV7xzUSIQxLFj4 opeq69HuNjIsv6mwF5VOTmPDr2ooAM58LbHClXq24+Gmr4/bXT4ok1B9m45Wsa8DTyGe 3AYwh3oImcqu2PS96Nq1Ad0CAFnyr9abOKSAxrfePqhwzOtWsgycSxAu9HGR7nmqR0ad OAKGqOlEwa92nMJps4f7S4BDKrZ7UoCvcRbUNgnPMWwOaaLeSs99BZpmTpuKUELqDEgH xGd4biweT/2ekBoy5F29NUh6A/uXWmWiQNN0yPKqGfLTI3zhj5/9XDoFEDfnMna9imtJ vydA== X-Forwarded-Encrypted: i=1; AL+hErEj97Vw56t0YNnR9ymaDHmFcsZRnJrhVHCPhkrY43BfS6K8wSVVOuQcK1e27z4Z7AoRdQy3hsalkLh5dFc=@vger.kernel.org X-Gm-Message-State: APuU4Z8a1nI3D1sEXoh2DzUGsYe1i1l2C8BXnctZvi1o+7CpBvsdJCfy LBRpK/MDhssvWuRspPcCbg5602EpViyfBZ7jd/HJVe3gkXEnpKWxxxtq X-Gm-Gg: AZFdTZf2EZgeC2Jplmb0As6BRsY1j6Vb+onSDR2NTgCvQJwk9HAGNkEADIt3Jj7pVCA pBQB7WRYaTMwX6G9SNh+zId6JHTVmfh/Sr+koOfrmZlyVjvnB76QHiek6aXiCgh9K7Ns4+QWnQR l4W7KXMccPwtJ2I+rJiqU+gdQ8/zTM033YNS7oOlD/GxIsXRcXLiBY15CjWeOr6U++4kAaKmHNZ 6T4jDykbpEqSbj3ste/QGRM/LXWgENLh+MLFcOkPYXfPEAmQKx8CDtafBNNdOIrjxP75WcG/XqJ Y+89nkX4zJlaGU0XEp4hHLy0gG4Jdx8L/2WJX57eRcJ4vNVaVJ43yKqgGAl6kvDuOccXk6TVNbs CQ7iNc5S8WKlBTfI+hRlGSkXqv636vW8oT4IRLw6jXSchWED7rROO06QX1FxllBxwc4TZ0Nb0VJ r7UoWA94u34ISMlXsqT85SW5EaDfJ6XaHABqWY6wSH5C2SKvOZYLcjbOvGyF+9+zpmQj4MlekGf OPw5s/pOwsJc1/U3HGxF+Zg1cNo3MByrEs1EH0VmiwCO1KOjNum2SY5PK9VIDzkY51dwDz+IOdQ kxyukezaigHBlWDioWLJfUBZl1M0PlV+Srqguxy1SxDq1xuVhkDsZt2haOSZG1cDQQ== X-Received: by 2002:a05:600c:3555:b0:4a1:f377:5c68 with SMTP id 5b1f17b1804b1-4bb8881da76mr662871115e9.34.1796035957243; Mon, 30 Nov 2026 02:52:37 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbab390cf5sm487627885e9.7.2026.11.30.02.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 02:52:36 -0800 (PST) Date: Mon, 30 Nov 2026 10:52:35 +0000 From: David Laight To: Jakub Kicinski Cc: kyle.switch@motor-comm.com, 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 Subject: Re: [PATCH net-next v17 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers Message-ID: <20261130105235.1a1b4b4d@pumpkin> In-Reply-To: <20261110232652.2437155-1-kuba@kernel.org> References: <20261105031442.4164960-4-kyle.switch@motor-comm.com> <20261110232652.2437155-1-kuba@kernel.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 10 Nov 2026 15:26:52 -0800 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. The u16 variants are also pretty dubious. The result is always promoted to 'signed int' when used; which can have unforeseen consequences, eg ~(GENMASK_U16(15, 15) << 16). David > > 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. >