lkml.org 
[lkml]   [2022]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/4] x86/cpuid: refactor setup_clear_cpu_cap/clear_feature
From
Date
On Wed, 2022-06-22 at 08:07 -0700, Dave Hansen wrote:
> 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.
Will do next time!


>
> 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'.

To be honest I didn't try to fix any problem here, I just wanted to simplify
clear_feature() a bit by avoiding a recursive call to clear_cpu_cap.

>
> 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);
> > }

I'll try to think about a better changelog message for this.

Thank you!
Best regards,
Maxim Levitsky

\
 
 \ /
  Last update: 2022-06-22 18:02    [W:0.058 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site