lkml.org 
[lkml]   [2018]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 03/16] x86/mtrr: get MTRR number and support TOP_MEM2
Date
On 2018/9/4 3:04, Borislav Petkov wrote:
> It was "Hygon Dhyana" before now "Hygon" only. Can we agree on the
> naming nomenclature and stick with it.

OK, agree on it.

...

>> - if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
>> - (boot_cpu_data.x86 >= 0x0f)))
>> + if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
>> + boot_cpu_data.x86 >= 0x0f) ||
>> + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON))
>
> Why are you even touching this statement? The function returns early on
> !X86_VENDOR_AMD.

The statement is briefly equal to !(X86_VENDOR_AMD || X86_VENDOR_HYGON).
So the function will not return early on !X86_VENDOR_AMD. :-)

Also the statement can be changed to:
+ if (!(boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+ boot_cpu_data.x86 >= 0x0f) &&
+ !(boot_cpu_data.x86_vendor == X86_VENDOR_HYGON))
or:
+ if ((boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
+ boot_cpu_data.x86 < 0x0f) &&
+ (boot_cpu_data.x86_vendor != X86_VENDOR_HYGON))

Which statement is better?

Thanks,
Pu Wen

\
 
 \ /
  Last update: 2018-09-04 05:04    [W:0.058 / U:9.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site