[PATCH 0/2] *cpufreq: Use FIELD_MODIFY() for bitfield operations

Hans Zhang posted 2 patches 1 month, 2 weeks ago
drivers/cpufreq/amd-pstate.c        | 26 ++++++++++----------------
drivers/cpufreq/apple-soc-cpufreq.c |  6 ++----
2 files changed, 12 insertions(+), 20 deletions(-)
[PATCH 0/2] *cpufreq: Use FIELD_MODIFY() for bitfield operations
Posted by Hans Zhang 1 month, 2 weeks ago
Replace open-coded bitfield modifications with the standard FIELD_MODIFY()
macro. This improves code readability and safety without functional
changes.

FIELD_MODIFY() internally performs the same mask-clear + set operation but
adds type checking and compile-time field boundary verification.

Hans Zhang (2):
  cpufreq/amd-pstate: Use FIELD_MODIFY()
  cpufreq: apple-soc: Use FIELD_MODIFY()

 drivers/cpufreq/amd-pstate.c        | 26 ++++++++++----------------
 drivers/cpufreq/apple-soc-cpufreq.c |  6 ++----
 2 files changed, 12 insertions(+), 20 deletions(-)


base-commit: 3b3bea6d4b9c162f9e555905d96b8c1da67ecd5b
-- 
2.34.1
Re: [PATCH 0/2] *cpufreq: Use FIELD_MODIFY() for bitfield operations
Posted by Viresh Kumar 1 month, 2 weeks ago
On 01-05-26, 00:32, Hans Zhang wrote:
> Replace open-coded bitfield modifications with the standard FIELD_MODIFY()
> macro. This improves code readability and safety without functional
> changes.
> 
> FIELD_MODIFY() internally performs the same mask-clear + set operation but
> adds type checking and compile-time field boundary verification.
> 
> Hans Zhang (2):
>   cpufreq/amd-pstate: Use FIELD_MODIFY()
>   cpufreq: apple-soc: Use FIELD_MODIFY()
> 
>  drivers/cpufreq/amd-pstate.c        | 26 ++++++++++----------------
>  drivers/cpufreq/apple-soc-cpufreq.c |  6 ++----
>  2 files changed, 12 insertions(+), 20 deletions(-)

Applied. Thanks.

-- 
viresh