Re: [PATCH] kexec: typo in machine_kexec()

Horms
2006-05-21T02:03:54Z

kexec: rework kexec_crash logic to make it a little less nested

Signed-Off-By: Simon Horman <horms@verge.net.au>

kernel/kexec.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

6d28ed0c03ff2d9345a5b198a52f6ee3cc7dd424
diff --git a/kernel/kexec.c b/kernel/kexec.c
index bf39d28..281736f 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1042,6 +1042,7 @@ #endif

void crash_kexec(struct pt_regs *regs)
{
+ struct pt_regs fixed_regs;
struct kimage *image;
int locked;

@@ -1055,16 +1056,15 @@ void crash_kexec(struct pt_regs *regs)
* sufficient. But since I reuse the memory...
*/
locked = xchg(&kexec_lock, 1);
- if (!locked) {
- image = xchg(&kexec_crash_image, NULL);
- if (image) {
- struct pt_regs fixed_regs;
- crash_setup_regs(&fixed_regs, regs);
- machine_crash_shutdown(&fixed_regs);
- machine_kexec(image);
- }
- xchg(&kexec_lock, 0);
+ if (locked)
+ return;
+ image = xchg(&kexec_crash_image, NULL);
+ if (image) {
+ crash_setup_regs(&fixed_regs, regs);
+ machine_crash_shutdown(&fixed_regs);
+ machine_kexec(image);
}
+ xchg(&kexec_lock, 0);
}

static int __init crash_notes_memory_init(void)