lkml.org 
[lkml]   [2014]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH 1/3] x86: Adding structs to reflect cpuid fields
On Wed, Sep 17, 2014 at 05:04:33PM +0200, Radim Krčmář wrote:
> which would result in a similar if-else hack
>
> if (family > X)
> ebx.split.max_monitor_line_size_after_family_X = 0
> else
> ebx.split.max_monitor_line_size = 0
>
> other options are
> ebx.split.after_family_X.max_monitor_line_size
> or even
> ebx.split.max_monitor_line_size.after_family_X

And how is that better than simply doing

cpuid = cpuid_ebx(5);

if (family > X)
max_monitor_line_size = cpuid & MASK_FAM_X;
else
max_monitor_line_size = cpuid & MASK_BEFORE_FAM_X;

?

With proper variable naming all is perfectly clear, readable
and simple. You don't need to open even the CPUID manual - the
variable tells you you're getting the max monitor line size -
"ebx.split.max_monitor_line_size_after_family_X" needs me to parse it
with my eyes first.

--
Regards/Gruss,
Boris.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-09-17 18:01    [W:0.261 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site