Re: [PATCH 2/4] x86/cpuid: refactor setup_clear_cpu_cap/clear_feature

From: Dave Hansen
Date: Wed Jun 22 2022 - 11:07:58 EST


On 6/22/22 07:48, Maxim Levitsky wrote:
> Simplify the code a bit by always passing &boot_cpu_data
> in case the setup_clear_cpu_cap was called.
>
> Also unify clear_cpu_cap and do_clear_cpu_cap.

Please always add a "()" suffix to functions. "foo" is a variable, but
"foo()" is a function.

I also really like when a changelog has a clear problem statement. I
_think_ the problem here is something along the lines of the 'c'
argument to clear_feature() having different behavior when it is NULL
versus '&boot_cpu_data'.

Basically, there's no reason to support clearing a bit in
'&boot_cpu_data' without also setting that bit in 'cpu_caps_cleared'.
> {
> - do_clear_cpu_cap(NULL, feature);
> + clear_cpu_cap(&boot_cpu_data, feature);
> }