提交 a95436e4 编写于 作者: B Borislav Petkov 提交者: H. Peter Anvin

x86, mce: use atomic_inc_return() instead of add by 1

Use atomic_inc_return() instead of atomic_add_return() by 1.
Signed-off-by: NBorislav Petkov <borislav.petkov@amd.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
上级 e4876839
...@@ -242,7 +242,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp) ...@@ -242,7 +242,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
/* /*
* Make sure only one CPU runs in machine check panic * Make sure only one CPU runs in machine check panic
*/ */
if (atomic_add_return(1, &mce_paniced) > 1) if (atomic_inc_return(&mce_paniced) > 1)
wait_for_panic(); wait_for_panic();
barrier(); barrier();
...@@ -705,7 +705,7 @@ static int mce_start(int *no_way_out) ...@@ -705,7 +705,7 @@ static int mce_start(int *no_way_out)
* global_nwo should be updated before mce_callin * global_nwo should be updated before mce_callin
*/ */
smp_wmb(); smp_wmb();
order = atomic_add_return(1, &mce_callin); order = atomic_inc_return(&mce_callin);
/* /*
* Wait for everyone. * Wait for everyone.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册