From nobody Thu Apr 2 15:41:18 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 C700F35BDCA for ; Sat, 28 Mar 2026 08:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774685209; cv=none; b=b5xTE2R2izwwuxmhrnTX7WIjG1iDYF+V8xKul6TVab7SJoHJoOj/7zJBJ2hS1mP9B+x7GLnyIQTR7kt+frRUNpHj3FQaO8GCeBzbNGc7mSczYXna4XlQVChrOdmV8X1gErTRBhpoj9Ix8ZjXf8Hp0X4HNeDDhzpp2xDleOrtVN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774685209; c=relaxed/simple; bh=E74W6nH3ZrQ4E00ZeLeqf9l5vDDcBRk2GgTkGYDcsnU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VpOaXDLW9TyeJZWlymLy1l55uORERM4aYMqW9PItkhZ23ugZqZXVB2o8TWOeffxO9x5fSTAzq0gfz69+D3eavUcCzQWoeKIz5OpZH6axsDyxesjXR6DuE4rwE3x4YoVdiTYbGJk1KJo5ykkzpKZd5BLF8niE85b9F6x3ocHXRZ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RDtnZm8y; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RDtnZm8y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774685207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ECRkEV0y7jPQuSatK5DISHS6RDYSFDFgyIg4X2z/Hz8=; b=RDtnZm8yzKGBzHE97BMZY9DcQQOswzNRmjlYcL8EO37pGILWxSrWFMLKzVOngj5VHwP1EG J2BSaqQYxIHYB+lU0Xd3cbgi8Mgb2qxKAdRl2dm4Rk1MTVLC+V0sItE9bDipNkdj1eByIS Tm7Y/+qq0snoriTLZVu0C9ulbyn0A4I= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-W9HIqAKUOuu50OmldXWPQQ-1; Sat, 28 Mar 2026 04:06:41 -0400 X-MC-Unique: W9HIqAKUOuu50OmldXWPQQ-1 X-Mimecast-MFC-AGG-ID: W9HIqAKUOuu50OmldXWPQQ_1774685199 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D696195608B; Sat, 28 Mar 2026 08:06:39 +0000 (UTC) Received: from p16v.redhat.com (unknown [10.44.32.48]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3F5411800351; Sat, 28 Mar 2026 08:06:35 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Petr Oros , Prathosh Satish , Arkadiusz Kubalewski , Jiri Pirko , Michal Schmidt , Simon Horman , Vadim Fedorenko , linux-kernel@vger.kernel.org, Conor Dooley , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, Pasi Vaananen Subject: [PATCH net-next v2 2/5] dpll: zl3073x: use FIELD_MODIFY() for clear-and-set patterns Date: Sat, 28 Mar 2026 09:06:21 +0100 Message-ID: <20260328080624.593916-3-ivecera@redhat.com> In-Reply-To: <20260328080624.593916-1-ivecera@redhat.com> References: <20260328080624.593916-1-ivecera@redhat.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-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" Replace open-coded clear-and-set bitfield operations with FIELD_MODIFY(). Reviewed-by: Petr Oros Reviewed-by: Prathosh Satish Signed-off-by: Ivan Vecera --- drivers/dpll/zl3073x/chan.h | 17 ++++++----------- drivers/dpll/zl3073x/core.c | 3 +-- drivers/dpll/zl3073x/flash.c | 3 +-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/dpll/zl3073x/chan.h b/drivers/dpll/zl3073x/chan.h index e0f02d3432086..481da2133202b 100644 --- a/drivers/dpll/zl3073x/chan.h +++ b/drivers/dpll/zl3073x/chan.h @@ -66,8 +66,7 @@ static inline u8 zl3073x_chan_ref_get(const struct zl3073= x_chan *chan) */ static inline void zl3073x_chan_mode_set(struct zl3073x_chan *chan, u8 mod= e) { - chan->mode_refsel &=3D ~ZL_DPLL_MODE_REFSEL_MODE; - chan->mode_refsel |=3D FIELD_PREP(ZL_DPLL_MODE_REFSEL_MODE, mode); + FIELD_MODIFY(ZL_DPLL_MODE_REFSEL_MODE, &chan->mode_refsel, mode); } =20 /** @@ -77,8 +76,7 @@ static inline void zl3073x_chan_mode_set(struct zl3073x_c= han *chan, u8 mode) */ static inline void zl3073x_chan_ref_set(struct zl3073x_chan *chan, u8 ref) { - chan->mode_refsel &=3D ~ZL_DPLL_MODE_REFSEL_REF; - chan->mode_refsel |=3D FIELD_PREP(ZL_DPLL_MODE_REFSEL_REF, ref); + FIELD_MODIFY(ZL_DPLL_MODE_REFSEL_REF, &chan->mode_refsel, ref); } =20 /** @@ -110,13 +108,10 @@ zl3073x_chan_ref_prio_set(struct zl3073x_chan *chan, = u8 ref, u8 prio) { u8 *val =3D &chan->ref_prio[ref / 2]; =20 - if (!(ref & 1)) { - *val &=3D ~ZL_DPLL_REF_PRIO_REF_P; - *val |=3D FIELD_PREP(ZL_DPLL_REF_PRIO_REF_P, prio); - } else { - *val &=3D ~ZL_DPLL_REF_PRIO_REF_N; - *val |=3D FIELD_PREP(ZL_DPLL_REF_PRIO_REF_N, prio); - } + if (!(ref & 1)) + FIELD_MODIFY(ZL_DPLL_REF_PRIO_REF_P, val, prio); + else + FIELD_MODIFY(ZL_DPLL_REF_PRIO_REF_N, val, prio); } =20 /** diff --git a/drivers/dpll/zl3073x/core.c b/drivers/dpll/zl3073x/core.c index 6363002d48d46..7eebfc1ad1019 100644 --- a/drivers/dpll/zl3073x/core.c +++ b/drivers/dpll/zl3073x/core.c @@ -743,8 +743,7 @@ int zl3073x_dev_phase_avg_factor_set(struct zl3073x_dev= *zldev, u8 factor) value =3D (factor + 1) & 0x0f; =20 /* Update phase measurement control register */ - dpll_meas_ctrl &=3D ~ZL_DPLL_MEAS_CTRL_AVG_FACTOR; - dpll_meas_ctrl |=3D FIELD_PREP(ZL_DPLL_MEAS_CTRL_AVG_FACTOR, value); + FIELD_MODIFY(ZL_DPLL_MEAS_CTRL_AVG_FACTOR, &dpll_meas_ctrl, value); rc =3D zl3073x_write_u8(zldev, ZL_REG_DPLL_MEAS_CTRL, dpll_meas_ctrl); if (rc) return rc; diff --git a/drivers/dpll/zl3073x/flash.c b/drivers/dpll/zl3073x/flash.c index 83452a77e3e98..f85535c8ad246 100644 --- a/drivers/dpll/zl3073x/flash.c +++ b/drivers/dpll/zl3073x/flash.c @@ -194,8 +194,7 @@ zl3073x_flash_cmd_wait(struct zl3073x_dev *zldev, u32 o= peration, if (rc) return rc; =20 - value &=3D ~ZL_WRITE_FLASH_OP; - value |=3D FIELD_PREP(ZL_WRITE_FLASH_OP, operation); + FIELD_MODIFY(ZL_WRITE_FLASH_OP, &value, operation); =20 rc =3D zl3073x_write_u8(zldev, ZL_REG_WRITE_FLASH, value); if (rc) --=20 2.52.0