lkml.org 
[lkml]   [2012]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -v2 4/6] x86, RAS: Add function enabling direct writes to MCE MSRs
From
Date
On Tue, 2012-10-16 at 16:52 +0200, Borislav Petkov wrote:
> From: Borislav Petkov <borislav.petkov@amd.com>
>
> Normally, writing to MCE MSRs causes a #GP. Add a function to enable
> direct accesses to those MSRs.
[]
> diff --git a/arch/x86/ras/amd/mce-inject.c b/arch/x86/ras/amd/mce-inject.c

> @@ -55,6 +55,30 @@ DEFINE_SIMPLE_ATTRIBUTE(misc_fops, inj_misc_get, inj_misc_set, "%llx\n");
[]
> +static int toggle_hw_mce_inject(unsigned int cpu, bool enable)
[]
> + enable ? (l |= BIT(18)) : (l &= ~BIT(18));

This is very unusual style.
I found just one like it in the kernel tree.
(unnecessary parens here too btw)

This style is much more common:
if (enable)
l |= BIT(18);
else
l &= ~BIT(18);





\
 
 \ /
  Last update: 2012-10-16 20:41    [W:0.289 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site