From nobody Sat Jun 20 14:14:06 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3]) (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 23EE646AF2B; Thu, 30 Apr 2026 16:40:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567248; cv=none; b=jt/oxwICnHkp5+MBgZKVnl3T3s+iyfVcOO7crIXVM3SMiw+7oqxUHcSxDOMybT2xpNugs23/lH7LFRj0e4La2QT1748auekW4MXy0A2xEmNb2NNxkiVUloXM1wc2GJlI36/4wUCxm8HnTbSNipmJ6EdWNCxSyipx3MEQWxw780U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567248; c=relaxed/simple; bh=daaboz3lT0timGg6vXzQNu6jqBf2GgW/CH3PoOFfb44=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qy3nBJ3IPJMWpPtDCiARtearHb5Q0zrvkVvSYg14B6Qki0Wyv0ALxDzykNYzJ/CBMHNdSfQOnD7Pf/slsE/ISJB9boDC+QsTLxz2APozk3P4NMlKSKUs+5xErCr9bZa2QjXBOpyUKwtf3sG2RSBdvd8JeG60dflrjAmT/LonSpw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=Q/S+pJtk; arc=none smtp.client-ip=220.197.31.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="Q/S+pJtk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=vS LKw/EEYLKveE2xBfEMTup8/azVODA4pMSSclWxodw=; b=Q/S+pJtk04i9h8WuFE 0fZEh0udPon40eNurFhhR91lmf3n6abGkbo05EE7IsBvBMImfPSM1HOebmu5nvE8 HspkYhLaZk/lKGsSlqpTTe4nQTvnNevpd7l6/gXCIa8S8DAhL7zQTjFEyKVc9rKJ 9XVZ5iVvH92Xg7BBBfyXSZuxs= Received: from zhb.. (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDnUmm+hfNptZrZCg--.19910S3; Fri, 01 May 2026 00:39:27 +0800 (CST) From: Hans Zhang <18255117159@163.com> To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, peter.griffin@linaro.org, andre.draszik@linaro.org, tudor.ambarus@linaro.org, mathias.nyman@intel.com, chunfeng.yun@mediatek.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, badhri@google.com, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, Hans Zhang <18255117159@163.com> Subject: [PATCH 1/6] usb: dwc3: Use FIELD_MODIFY() Date: Fri, 1 May 2026 00:39:14 +0800 Message-Id: <20260430163919.47372-2-18255117159@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260430163919.47372-1-18255117159@163.com> References: <20260430163919.47372-1-18255117159@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDnUmm+hfNptZrZCg--.19910S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7urW7uF4xtFW5Xryktr4ruFg_yoW8XrW7pr y8tr1a9an3t3WfA3s3WF4jyF1Yq348tryIga47twnrZwn8CrWUWFZxGFy5XF1UJasagFyU Wa1xtry5GFZFgaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piXAw-UUUUU= X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbCxADojGnzhcDnvgAA3m Content-Type: text/plain; charset="utf-8" Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> --- drivers/usb/dwc3/core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 58899b1fa96d..f95201470ab2 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -425,8 +425,7 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc) } =20 reg =3D dwc3_readl(dwc, DWC3_GUCTL); - reg &=3D ~DWC3_GUCTL_REFCLKPER_MASK; - reg |=3D FIELD_PREP(DWC3_GUCTL_REFCLKPER_MASK, period); + FIELD_MODIFY(DWC3_GUCTL_REFCLKPER_MASK, ®, period); dwc3_writel(dwc, DWC3_GUCTL, reg); =20 if (DWC3_VER_IS_PRIOR(DWC3, 250A)) @@ -456,12 +455,9 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc) decr =3D 480000000 / rate; =20 reg =3D dwc3_readl(dwc, DWC3_GFLADJ); - reg &=3D ~DWC3_GFLADJ_REFCLK_FLADJ_MASK - & ~DWC3_GFLADJ_240MHZDECR - & ~DWC3_GFLADJ_240MHZDECR_PLS1; - reg |=3D FIELD_PREP(DWC3_GFLADJ_REFCLK_FLADJ_MASK, fladj) - | FIELD_PREP(DWC3_GFLADJ_240MHZDECR, decr >> 1) - | FIELD_PREP(DWC3_GFLADJ_240MHZDECR_PLS1, decr & 1); + FIELD_MODIFY(DWC3_GFLADJ_REFCLK_FLADJ_MASK, ®, fladj); + FIELD_MODIFY(DWC3_GFLADJ_240MHZDECR, ®, decr >> 1); + FIELD_MODIFY(DWC3_GFLADJ_240MHZDECR_PLS1, ®, decr & 1); =20 if (dwc->gfladj_refclk_lpm_sel) reg |=3D DWC3_GFLADJ_REFCLK_LPM_SEL; --=20 2.34.1 From nobody Sat Jun 20 14:14:06 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) (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 5B818477980; Thu, 30 Apr 2026 16:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567234; cv=none; b=JRAyq9pUdfxnYQBg7dH2jt6Kg14HGXj7MgoZW6kLlSEgTOdeSAjG2yG5rsEdnfrjEEPs6TNDcndB+0JjzsKnmMe2O8GYpwlECEBV5E8sPBKs3hQe4ocCkUETBicqYyfqOeTxk1hfC76GVPGfHUT4VGIvzb+eiijX0Y3d1Mx/040= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567234; c=relaxed/simple; bh=sKOEqJsOrWKT8++JhNth1eqD0mPHunjATG+2YZfV7qY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GjqfWqTImOwzGm9oVfRwS+zeD4DTwG+U421YilzByApWMVfjU6OPRAlHeTvRG01DB4PA4UIwhwLVYT+AdH1MmckWXCajoZvHJRShU7kjSsoOaHM1OFHhuhObHD1LO99G+Mqxjz+Ezco6I7UG0McWzM5v5BFnPRrVcL1YwTe/wGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=A4+Y8Gsw; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="A4+Y8Gsw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=+y 6l1pdaoPallINfZ97mYoBt0a1nOeHpavNgPm3SNZU=; b=A4+Y8GswvRq4Q6OR/R XJ0wL77xFznNKE3+KXDYF9hgEPKh70hDL/7zq8/Q7lvBhA+yIn0vKXROtKF+X4NA vMcA5moJRaLcM+punh/dQAWSAOvfyOejRIxvI3Lu6F0dkRr2vtIOMpRV8IYMKAxm SlwlnxwrUw96sYfqXXbMQOFjE= Received: from zhb.. (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDnUmm+hfNptZrZCg--.19910S4; Fri, 01 May 2026 00:39:28 +0800 (CST) From: Hans Zhang <18255117159@163.com> To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, peter.griffin@linaro.org, andre.draszik@linaro.org, tudor.ambarus@linaro.org, mathias.nyman@intel.com, chunfeng.yun@mediatek.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, badhri@google.com, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, Hans Zhang <18255117159@163.com> Subject: [PATCH 2/6] usb: dwc3: google: Use FIELD_MODIFY() Date: Fri, 1 May 2026 00:39:15 +0800 Message-Id: <20260430163919.47372-3-18255117159@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260430163919.47372-1-18255117159@163.com> References: <20260430163919.47372-1-18255117159@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDnUmm+hfNptZrZCg--.19910S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrur17tw4fCFy3CF4DCw17Wrg_yoWDWwc_W3 45Ar1Svr1Dua9xtF1qk34fZryqqw10q34xuF1jqay3Gr1UKFW8WrWvvryktryrZry7Zrn2 kr4DuryY93srtjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRu89K3UUUUU== X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC6wDojGnzhcDQDgAA3O Content-Type: text/plain; charset="utf-8" Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> --- drivers/usb/dwc3/dwc3-google.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-google.c b/drivers/usb/dwc3/dwc3-google.c index 4ca567ec01d0..60ee4cc99b28 100644 --- a/drivers/usb/dwc3/dwc3-google.c +++ b/drivers/usb/dwc3/dwc3-google.c @@ -104,9 +104,8 @@ static int dwc3_google_set_pmu_state(struct dwc3_google= *google, int state) regmap_read(google->usb_cfg_regmap, google->host_cfg_offset + HOST_CFG1_OFFSET, ®); =20 - reg &=3D ~HOST_CFG1_PM_POWER_STATE_REQUEST; - reg |=3D (FIELD_PREP(HOST_CFG1_PM_POWER_STATE_REQUEST, state) | - HOST_CFG1_PME_EN); + FIELD_MODIFY(HOST_CFG1_PM_POWER_STATE_REQUEST, ®, state); + reg |=3D HOST_CFG1_PME_EN; regmap_write(google->usb_cfg_regmap, google->host_cfg_offset + HOST_CFG1_OFFSET, reg); =20 --=20 2.34.1 From nobody Sat Jun 20 14:14:06 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) (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 D3B3B337BAC; Thu, 30 Apr 2026 16:40:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567229; cv=none; b=YKA5f/6FeraA+VoAmUWKVt+ufTEEHNyPMp3o4jQzIun9/TRN6tBv0AyiyfWxQJ/Xli6aLErEXSqNbWYPzEvGmwwRzCOTZKaj4KAjSqS9laEbRLDPbbihSKbVgq1540XfbaOVWSifqOoQ3zDht6mrvTxtB3yqD7ah8qg4CBLqwEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567229; c=relaxed/simple; bh=+E992wzniah1sWwkNrlSqzVJL/pB4W3oz+j8HWD7/E8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dWWIgeBKG2dTEn34YBV15UpL8TUr9ZezzigF5Fco6R1bJVIla21m+/KVcyxEK8McdWC8kLLiuzFMoiXo95P4V+SZ4fHyIGYUTwT84BGgnDpVJg0dNjA0wN7SVMiPR6J4bmJOaDdWJBLUNJ7IWceudhHS0g4ggUavB6duwKz9omw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=aBApgiEB; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="aBApgiEB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=88 3GNpBzpZT0kzzAWtcd9tO1xmCz7U41eOWRk1IoUcE=; b=aBApgiEBRCh8GzVMLy sYAoVuCiAGbqNJcc7dwTsdqcy5YuCx3TX3zgJNtGzX5N9/hKFb/C+KMomq9mKTa6 24S/FWE+ZpeXof0dISgzC74Co3jjfwtR58/OAHFrtIa6Olem0V8VtXxDViYDgyFJ GffQj64057y+SfMYmnXG7iuSs= Received: from zhb.. (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDnUmm+hfNptZrZCg--.19910S5; Fri, 01 May 2026 00:39:29 +0800 (CST) From: Hans Zhang <18255117159@163.com> To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, peter.griffin@linaro.org, andre.draszik@linaro.org, tudor.ambarus@linaro.org, mathias.nyman@intel.com, chunfeng.yun@mediatek.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, badhri@google.com, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, Hans Zhang <18255117159@163.com> Subject: [PATCH 3/6] usb: dwc3: dwc3-octeon: Use FIELD_MODIFY() Date: Fri, 1 May 2026 00:39:16 +0800 Message-Id: <20260430163919.47372-4-18255117159@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260430163919.47372-1-18255117159@163.com> References: <20260430163919.47372-1-18255117159@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDnUmm+hfNptZrZCg--.19910S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7urW7uF4fKFyxAryfZFyrWFg_yoW8Aw4rpw n8C3WSyFnFkrn5uw45Gay8Aryrtay2krW8KryDJ3yxZw4DXrn7Wayqkw4rtrn8Wa4xtF10 k3yvyrW3uFW5AF7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zi-B_bUUUUU= X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC7AHojGnzhcHZvgAA3w Content-Type: text/plain; charset="utf-8" Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> --- drivers/usb/dwc3/dwc3-octeon.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-octeon.c b/drivers/usb/dwc3/dwc3-octeon.c index 42bfc14ae0c4..2201f0f34abb 100644 --- a/drivers/usb/dwc3/dwc3-octeon.c +++ b/drivers/usb/dwc3/dwc3-octeon.c @@ -296,8 +296,7 @@ static int dwc3_octeon_setup(struct dwc3_octeon *octeon, return div; } val =3D dwc3_octeon_readq(uctl_ctl_reg); - val &=3D ~USBDRD_UCTL_CTL_H_CLKDIV_SEL; - val |=3D FIELD_PREP(USBDRD_UCTL_CTL_H_CLKDIV_SEL, div); + FIELD_MODIFY(USBDRD_UCTL_CTL_H_CLKDIV_SEL, &val, div); val |=3D USBDRD_UCTL_CTL_H_CLK_EN; dwc3_octeon_writeq(uctl_ctl_reg, val); val =3D dwc3_octeon_readq(uctl_ctl_reg); @@ -314,14 +313,11 @@ static int dwc3_octeon_setup(struct dwc3_octeon *octe= on, /* Step 5a: Reference clock configuration. */ val =3D dwc3_octeon_readq(uctl_ctl_reg); val &=3D ~USBDRD_UCTL_CTL_REF_CLK_DIV2; - val &=3D ~USBDRD_UCTL_CTL_REF_CLK_SEL; - val |=3D FIELD_PREP(USBDRD_UCTL_CTL_REF_CLK_SEL, ref_clk_sel); + FIELD_MODIFY(USBDRD_UCTL_CTL_REF_CLK_SEL, &val, ref_clk_sel); =20 - val &=3D ~USBDRD_UCTL_CTL_REF_CLK_FSEL; - val |=3D FIELD_PREP(USBDRD_UCTL_CTL_REF_CLK_FSEL, ref_clk_fsel); + FIELD_MODIFY(USBDRD_UCTL_CTL_REF_CLK_FSEL, &val, ref_clk_fsel); =20 - val &=3D ~USBDRD_UCTL_CTL_MPLL_MULTIPLIER; - val |=3D FIELD_PREP(USBDRD_UCTL_CTL_MPLL_MULTIPLIER, mpll_mul); + FIELD_MODIFY(USBDRD_UCTL_CTL_MPLL_MULTIPLIER, &val, mpll_mul); =20 /* Step 5b: Configure and enable spread-spectrum for SuperSpeed. */ val |=3D USBDRD_UCTL_CTL_SSC_EN; --=20 2.34.1 From nobody Sat Jun 20 14:14:06 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.5]) (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 78DBF32BF4B; Thu, 30 Apr 2026 16:40:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567238; cv=none; b=EsN+l6V946OOzJsRt4EwJwXWPTbWc38ieVTi4qik2u37aLVsuFco2WTxjfFFfCfzGqR1n8KgUNPrn1lngPQwMs04gLMCGDwtRD7AvVO54+p9y5tYsY7BbzsUpfSTekCo/GL0/4MJFWOfn0GhRBtC4rolhOjMpcHmb0KzSHFWt7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567238; c=relaxed/simple; bh=HOK2E82bYiFCp2M7RC7/7SO+QWrc4znNEYJzpgMaGMs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QYjG4JtMZePn27aoisCJTwCAEbz75gEDo3C3o6aDoERoymQJC9qWnsKD/Au7INZTKHmPREH48NQtOKt1qoLfKDwz+OuJaqgQgdl+sqMtaYZebTSOZpHypbaLl8KnlajaGFpS9eHOiyamnBtUblMmou/jFPLZDRXzaI3O3hw1FLI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=O+xAUzPs; arc=none smtp.client-ip=117.135.210.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="O+xAUzPs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=Oq h8i/elFvAb7pieKkMXZjCnLslrNZI7sqbGtv3hqdU=; b=O+xAUzPs/HDqUs+ikB G7hjOUUaYIL9PKznoKTNCYL5WTzIrgt5QOApfGz4JuT8sC3sSOQ2qXcuRZf9z1kG wq8gV3ShKjLYMoXRxAYb6wQqSHAgqXbMoozitRj+0Bd4DfaN1qjczAsKe4UJ+CkO G5Q5TraabNFT57OsF9RwU7nro= Received: from zhb.. (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDnUmm+hfNptZrZCg--.19910S6; Fri, 01 May 2026 00:39:30 +0800 (CST) From: Hans Zhang <18255117159@163.com> To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, peter.griffin@linaro.org, andre.draszik@linaro.org, tudor.ambarus@linaro.org, mathias.nyman@intel.com, chunfeng.yun@mediatek.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, badhri@google.com, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, Hans Zhang <18255117159@163.com> Subject: [PATCH 4/6] usb: xhci: Use FIELD_MODIFY() Date: Fri, 1 May 2026 00:39:17 +0800 Message-Id: <20260430163919.47372-5-18255117159@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260430163919.47372-1-18255117159@163.com> References: <20260430163919.47372-1-18255117159@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDnUmm+hfNptZrZCg--.19910S6 X-Coremail-Antispam: 1Uf129KBjvdXoWrur17tw4rtFyftFy7Xr1fWFg_yoWDGrXEyF y5uw4fJ34kKr1YkF18ur97tr9Ykr95Xws5ZF1qgr1fWr18JFyxXwn7Xrn0qa45CFs7JrZ3 A3ykWry8ZF4vyjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRMfQRPUUUUU== X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC6wLojGnzhcLQVwAA3X Content-Type: text/plain; charset="utf-8" Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> --- drivers/usb/host/xhci-hub.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index bacd0ddd0d09..3830d4123961 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -226,9 +226,8 @@ static int xhci_create_usb3x_bos_desc(struct xhci_hcd *= xhci, char *buf, USB_SSP_SUBLINK_SPEED_ST_SYM_RX); ssp_cap->bmSublinkSpeedAttr[offset++] =3D cpu_to_le32(attr); =20 - attr &=3D ~USB_SSP_SUBLINK_SPEED_ST; - attr |=3D FIELD_PREP(USB_SSP_SUBLINK_SPEED_ST, - USB_SSP_SUBLINK_SPEED_ST_SYM_TX); + FIELD_MODIFY(USB_SSP_SUBLINK_SPEED_ST, &attr, + USB_SSP_SUBLINK_SPEED_ST_SYM_TX); ssp_cap->bmSublinkSpeedAttr[offset++] =3D cpu_to_le32(attr); break; case PLT_ASYM_RX: --=20 2.34.1 From nobody Sat Jun 20 14:14:06 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.5]) (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 25155217F33; Thu, 30 Apr 2026 16:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567229; cv=none; b=I5tzjb/VcK7ldyOT5g5kRO74jYvl5VNs3QmXdNPb2f+OOFIfxhvWYnuG1k+3nghjRXhZqXboxvKF2WqynsH5EcDdMqMUfP6urpwU4iUukHW1mbiMxTA0ct+TE61ruZgWvgrwX3k9u4SgDI840/wxixXTZiHsyemIEhiJJ1SWaeQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567229; c=relaxed/simple; bh=BPPMxRD2SSp6eDfvsK4p400r4gcT5Cp2ESrsOWEkukw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jG6xrRdTnYm4Q0mkkfs7+t5BwoFHOfFZYEhaZIl5JXOBE9hMsMu7t3lJbWYgSoXChQanbvWgvzp/su66eDNx7Zhf50Bb76KDgv+R0cG/2sUwzAWNIw6f1DOfxFfgeaR/9E63aVEO/leHEsIUHaS7Prq1F0j3ya8sg8UicXR8mO4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=dYCPvYtv; arc=none smtp.client-ip=220.197.31.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="dYCPvYtv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=8L R2nmJ62loXDtxlHutXhsVIE0IN6VZYRDDuR+Lj7rE=; b=dYCPvYtvGlhcQPpKyi 69+S6+sI3KzxYSFm1SLj0ihlOiYuQkqwdCRnUuYlp7/EyjE/HOEx8xA8LFWix+mJ P2vDM+TBBFCwIszaC/SckWPh3hRyIiIZvTDGXw4L64gP+7eZha4lIMwFtEIHTshT /D5F6Kiz52GfApUlOjZtE/mTY= Received: from zhb.. (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDnUmm+hfNptZrZCg--.19910S7; Fri, 01 May 2026 00:39:31 +0800 (CST) From: Hans Zhang <18255117159@163.com> To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, peter.griffin@linaro.org, andre.draszik@linaro.org, tudor.ambarus@linaro.org, mathias.nyman@intel.com, chunfeng.yun@mediatek.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, badhri@google.com, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, Hans Zhang <18255117159@163.com> Subject: [PATCH 5/6] usb: xhci-mtk: Use FIELD_MODIFY() Date: Fri, 1 May 2026 00:39:18 +0800 Message-Id: <20260430163919.47372-6-18255117159@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260430163919.47372-1-18255117159@163.com> References: <20260430163919.47372-1-18255117159@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDnUmm+hfNptZrZCg--.19910S7 X-Coremail-Antispam: 1Uf129KBjvdXoWrur17tw4rtFyftFyruw15Arb_yoWfXrg_Cr 95Cr1xJas0kwsxCr4DCF15ArWqkrykXw48ZasFqrW3Ka4Utr1Sqryvkry8tFy3ZF4fGrn5 GanIgry8Kw4FvjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRMTmS3UUUUU== X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC7APojGnzhcPaBgAA3L Content-Type: text/plain; charset="utf-8" Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> --- drivers/usb/host/xhci-mtk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 06043c7c3100..d9b865546a67 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -185,9 +185,9 @@ static void xhci_mtk_rxfifo_depth_set(struct xhci_hcd_m= tk *mtk) return; =20 value =3D readl(hcd->regs + HSCH_CFG1); - value &=3D ~SCH3_RXFIFO_DEPTH_MASK; - value |=3D FIELD_PREP(SCH3_RXFIFO_DEPTH_MASK, - SCH_FIFO_TO_KB(mtk->rxfifo_depth) - 1); + FIELD_MODIFY(SCH3_RXFIFO_DEPTH_MASK, &value, + SCH_FIFO_TO_KB(mtk->rxfifo_depth) - 1); + writel(value, hcd->regs + HSCH_CFG1); } =20 --=20 2.34.1 From nobody Sat Jun 20 14:14:06 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (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 49E5F340281; Thu, 30 Apr 2026 16:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567250; cv=none; b=E0EcxRlb4bAiM0wDhLGDU1u6pE1QE9GCD5F0hkPDECNDBfU7gfcOeklJquoV0ioJlhbaJXve9fGfHksnSH5gCOjQlDRlMl+FBjrjAQ2rp2DBVnDuGIewslc2Qxr+GkUo+LrJKgGTIcgat8Ik8c0+0iHxza9oWNJ+YISIBcNqagU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777567250; c=relaxed/simple; bh=litEndzInZQlLNhJFQfIMPTNL+60r06FJMhplvXKHFY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FPnxeriSf3wZm//CR0oZKwVO7vITmlQNQXqXNJqfxsbpewBhkY/7Qn995rIpK2+n1q5CqqcgYEj7E0A+8/+dyQr95Z1+EV6erwZshDByofY3h72n8P/7K5+wqTB6zmW8LN9lZ7S3+LQ9+FcpU/BM4hBKeuOCqDORd8wxK8xNXA0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=W0e3U/bg; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="W0e3U/bg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=nm hpT4qL3TiNhJTJA/kcqIVRxB45Z2PLUQn6pZidorQ=; b=W0e3U/bgin+AuHDDL0 BIQE7AKnX9pGu7MeN0X9SlxSCh4a2+z6e7KWdCDcBevH0JL6NLRJWHi5ZoEMJB/+ dybTTH+4RPO0CBYg5V1jNxYmicqJSF/KCZf6YlYTr+sAlxa0EyFBnT2Dk7e2AkjC rovquYX589WMPKQ5gPBKI9a1E= Received: from zhb.. (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDnUmm+hfNptZrZCg--.19910S8; Fri, 01 May 2026 00:39:32 +0800 (CST) From: Hans Zhang <18255117159@163.com> To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, peter.griffin@linaro.org, andre.draszik@linaro.org, tudor.ambarus@linaro.org, mathias.nyman@intel.com, chunfeng.yun@mediatek.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, badhri@google.com, heikki.krogerus@linux.intel.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, Hans Zhang <18255117159@163.com> Subject: [PATCH 6/6] usb: typec: Use FIELD_MODIFY() Date: Fri, 1 May 2026 00:39:19 +0800 Message-Id: <20260430163919.47372-7-18255117159@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260430163919.47372-1-18255117159@163.com> References: <20260430163919.47372-1-18255117159@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDnUmm+hfNptZrZCg--.19910S8 X-Coremail-Antispam: 1Uf129KBjvdXoWrur17tw4fWw1UJw1Uuw43GFg_yoWkXFc_Gr 18C3Zayr9YvFW5A3W3Ga9akr1kta1jg3WagF1rtF1rAr1DKr18Wr45C3ykJFyjga1F9r95 CFn5XrykZr1fCjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRMTmS3UUUUU== X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbCxATpjWnzhcToYQAA32 Content-Type: text/plain; charset="utf-8" Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> --- drivers/usb/typec/tcpm/tcpci.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index 0148b8f50412..24c87dfa6b64 100644 --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -141,13 +141,10 @@ static int tcpci_set_cc(struct tcpc_dev *tcpc, enum t= ypec_cc_status cc) } =20 if (vconn_pres) { - if (polarity =3D=3D TYPEC_POLARITY_CC2) { - reg &=3D ~TCPC_ROLE_CTRL_CC1; - reg |=3D FIELD_PREP(TCPC_ROLE_CTRL_CC1, TCPC_ROLE_CTRL_CC_OPEN); - } else { - reg &=3D ~TCPC_ROLE_CTRL_CC2; - reg |=3D FIELD_PREP(TCPC_ROLE_CTRL_CC2, TCPC_ROLE_CTRL_CC_OPEN); - } + if (polarity =3D=3D TYPEC_POLARITY_CC2) + FIELD_MODIFY(TCPC_ROLE_CTRL_CC1, ®, TCPC_ROLE_CTRL_CC_OPEN); + else + FIELD_MODIFY(TCPC_ROLE_CTRL_CC2, ®, TCPC_ROLE_CTRL_CC_OPEN); } =20 ret =3D regmap_write(tcpci->regmap, TCPC_ROLE_CTRL, reg); --=20 2.34.1