]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpufreq: apple-soc: Use FIELD_MODIFY()
authorHans Zhang <18255117159@163.com>
Thu, 30 Apr 2026 16:32:13 +0000 (00:32 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 5 May 2026 03:59:21 +0000 (09:29 +0530)
Use FIELD_MODIFY() to remove open-coded bit manipulation.
No functional change intended.

Signed-off-by: Hans Zhang <18255117159@163.com>
Reviewed-by: Joshua Peisach <jpeisach@ubuntu.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/apple-soc-cpufreq.c

index 9396034167e503532515004aded19799ec2e940e..638e5bf72185a74dd84495ca41d3cdd784ea551f 100644 (file)
@@ -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, &reg, pstate);
        reg |= APPLE_DVFS_CMD_SET;
 
        writeq_relaxed(reg, priv->reg_base + APPLE_DVFS_CMD);