From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.97 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== 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== 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 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) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 01A7B606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motor-comm.com 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; 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 Message-ID: Date: Mon, 30 Nov 2026 15:34:02 +0800 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v17 3/5] net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers To: Jakub Kicinski 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 References: <20261105031442.4164960-4-kyle.switch@motor-comm.com> <20261110232652.2437155-1-kuba@kernel.org> Content-Language: en-US From: Kyle Switch In-Reply-To: <20261110232652.2437155-1-kuba@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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.