From: "Joshua Peisach" <jpeisach@ubuntu.com>
To: "Hans Zhang" <18255117159@163.com>, <ray.huang@amd.com>,
<mario.limonciello@amd.com>, <rafael@kernel.org>,
<viresh.kumar@linaro.org>, <sven@kernel.org>, <j@jannau.net>
Cc: <perry.yuan@amd.com>, <kprateek.nayak@amd.com>, <neal@gompa.dev>,
<linux-pm@vger.kernel.org>, <asahi@lists.linux.dev>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] cpufreq: apple-soc: Use FIELD_MODIFY()
Date: Thu, 30 Apr 2026 15:54:39 -0400 [thread overview]
Message-ID: <DI6R4FYDSY08.LDHU6EZTXS9X@ubuntu.com> (raw)
In-Reply-To: <20260430163213.44695-3-18255117159@163.com>
On Thu Apr 30, 2026 at 12:32 PM EDT, Hans Zhang wrote:
> Use FIELD_MODIFY() to remove open-coded bit manipulation.
> No functional change intended.
>
> Signed-off-by: Hans Zhang <18255117159@163.com>
> ---
> drivers/cpufreq/apple-soc-cpufreq.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c
> index 9396034167e5..638e5bf72185 100644
> --- a/drivers/cpufreq/apple-soc-cpufreq.c
> +++ b/drivers/cpufreq/apple-soc-cpufreq.c
> @@ -187,10 +187,8 @@ static int apple_soc_cpufreq_set_target(struct cpufreq_policy *policy,
>
> reg &= ~priv->info->ps1_mask;
> reg |= pstate << priv->info->ps1_shift;
> - if (priv->info->has_ps2) {
> - reg &= ~APPLE_DVFS_CMD_PS2;
> - reg |= FIELD_PREP(APPLE_DVFS_CMD_PS2, pstate);
> - }
> + if (priv->info->has_ps2)
> + FIELD_MODIFY(APPLE_DVFS_CMD_PS2, ®, pstate);
> reg |= APPLE_DVFS_CMD_SET;
>
> writeq_relaxed(reg, priv->reg_base + APPLE_DVFS_CMD);
Looks okay.
Reviewed-by: Joshua Peisach <jpeisach@ubuntu.com>
prev parent reply other threads:[~2026-04-30 19:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 16:32 [PATCH 0/2] *cpufreq: Use FIELD_MODIFY() for bitfield operations Hans Zhang
2026-04-30 16:32 ` [PATCH 1/2] cpufreq/amd-pstate: Use FIELD_MODIFY() Hans Zhang
2026-05-01 5:27 ` K Prateek Nayak
2026-04-30 16:32 ` [PATCH 2/2] cpufreq: apple-soc: " Hans Zhang
2026-04-30 19:54 ` Joshua Peisach [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DI6R4FYDSY08.LDHU6EZTXS9X@ubuntu.com \
--to=jpeisach@ubuntu.com \
--cc=18255117159@163.com \
--cc=asahi@lists.linux.dev \
--cc=j@jannau.net \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=neal@gompa.dev \
--cc=perry.yuan@amd.com \
--cc=rafael@kernel.org \
--cc=ray.huang@amd.com \
--cc=sven@kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox