aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/traps.c
diff options
context:
space:
mode:
authorDon Zickus <dzickus@redhat.com>2011-01-06 16:18:52 -0500
committerIngo Molnar <mingo@elte.hu>2011-01-07 09:08:53 -0500
commitf2fd43954abc058586e95d4eb91e7a5477070704 (patch)
tree9dbb3dc10de2145182e879582cb477d55ae9e92b /arch/x86/kernel/traps.c
parentab846f13f69fa64f8ed69ce0c3e239e075910d23 (diff)
x86, NMI: Clean-up default_do_nmi()
Just re-arrange the code a bit to make it easier to follow what is going on. Basically un-negating the if-statement and swapping the code inside the if-statement with code outside. No functional changes. Originally-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1294348732-15030-7-git-send-email-dzickus@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/traps.c')
-rw-r--r--arch/x86/kernel/traps.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 613b3d284a8..b9b67166f9d 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -410,26 +410,24 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
410 raw_spin_lock(&nmi_reason_lock); 410 raw_spin_lock(&nmi_reason_lock);
411 reason = get_nmi_reason(); 411 reason = get_nmi_reason();
412 412
413 if (!(reason & NMI_REASON_MASK)) { 413 if (reason & NMI_REASON_MASK) {
414 if (reason & NMI_REASON_SERR)
415 pci_serr_error(reason, regs);
416 else if (reason & NMI_REASON_IOCHK)
417 io_check_error(reason, regs);
418#ifdef CONFIG_X86_32
419 /*
420 * Reassert NMI in case it became active
421 * meanwhile as it's edge-triggered:
422 */
423 reassert_nmi();
424#endif
414 raw_spin_unlock(&nmi_reason_lock); 425 raw_spin_unlock(&nmi_reason_lock);
415 unknown_nmi_error(reason, regs);
416
417 return; 426 return;
418 } 427 }
419
420 /* AK: following checks seem to be broken on modern chipsets. FIXME */
421 if (reason & NMI_REASON_SERR)
422 pci_serr_error(reason, regs);
423 if (reason & NMI_REASON_IOCHK)
424 io_check_error(reason, regs);
425#ifdef CONFIG_X86_32
426 /*
427 * Reassert NMI in case it became active meanwhile
428 * as it's edge-triggered:
429 */
430 reassert_nmi();
431#endif
432 raw_spin_unlock(&nmi_reason_lock); 428 raw_spin_unlock(&nmi_reason_lock);
429
430 unknown_nmi_error(reason, regs);
433} 431}
434 432
435dotraplinkage notrace __kprobes void 433dotraplinkage notrace __kprobes void