summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Yucong <slaoub@gmail.com>2014-10-02 19:20:12 +0400
committerBorislav Petkov <bp@suse.de>2014-10-22 00:12:56 +0400
commit69b957583580bf40624553c64d802fefb54199cb (patch)
tree9ebb3ec22218dd0c9f99712a34340c7ba809cf32
parent44612a3ac671d7b9a9b987ab73dcc776204ac4d5 (diff)
downloadlinux-69b957583580bf40624553c64d802fefb54199cb.tar.xz
x86, MCE, AMD: Move invariant code out from loop body
Assigning to mce_threshold_vector is loop-invariant code in mce_amd_feature_init(). So do it only once, out of loop body. Signed-off-by: Chen Yucong <slaoub@gmail.com> Link: http://lkml.kernel.org/r/1412263212.8085.6.camel@debian [ Boris: commit message corrections. ] Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 9ce64955559d..9af7bd74828b 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -253,7 +253,9 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
}
mce_threshold_block_init(&b, offset);
- mce_threshold_vector = amd_threshold_interrupt;
+
+ if (mce_threshold_vector != amd_threshold_interrupt)
+ mce_threshold_vector = amd_threshold_interrupt;
}
}
}