[PATCH 04/10] x86, mce: use do-while in mce_log
From: Hidetoshi Seto
Date: Mon Oct 05 2009 - 02:37:48 EST
No changes in logic.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>
---
arch/x86/kernel/cpu/mcheck/mce.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 9e8eabd..5f88ada 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -134,7 +134,8 @@ void mce_log(struct mce *mce)
mce->finished = 0;
wmb();
- for (;;) {
+
+ do {
entry = rcu_dereference(mcelog.next);
for (;;) {
/*
@@ -156,14 +157,13 @@ void mce_log(struct mce *mce)
}
smp_rmb();
next = entry + 1;
- if (cmpxchg(&mcelog.next, entry, next) == entry)
- break;
- }
+ } while (cmpxchg(&mcelog.next, entry, next) != entry);
+
memcpy(mcelog.entry + entry, mce, sizeof(struct mce));
+
wmb();
mcelog.entry[entry].finished = 1;
wmb();
-
mce->finished = 1;
set_bit(0, &mce_need_notify);
}
--
1.6.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/