Skip to content

Commit

Permalink
x86, NMI: Clean-up default_do_nmi()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Don Zickus authored and Ingo Molnar committed Jan 7, 2011
1 parent ab846f1 commit f2fd439
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions arch/x86/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,26 +410,24 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
raw_spin_lock(&nmi_reason_lock);
reason = get_nmi_reason();

if (!(reason & NMI_REASON_MASK)) {
if (reason & NMI_REASON_MASK) {
if (reason & NMI_REASON_SERR)
pci_serr_error(reason, regs);
else if (reason & NMI_REASON_IOCHK)
io_check_error(reason, regs);
#ifdef CONFIG_X86_32
/*
* Reassert NMI in case it became active
* meanwhile as it's edge-triggered:
*/
reassert_nmi();
#endif
raw_spin_unlock(&nmi_reason_lock);
unknown_nmi_error(reason, regs);

return;
}

/* AK: following checks seem to be broken on modern chipsets. FIXME */
if (reason & NMI_REASON_SERR)
pci_serr_error(reason, regs);
if (reason & NMI_REASON_IOCHK)
io_check_error(reason, regs);
#ifdef CONFIG_X86_32
/*
* Reassert NMI in case it became active meanwhile
* as it's edge-triggered:
*/
reassert_nmi();
#endif
raw_spin_unlock(&nmi_reason_lock);

unknown_nmi_error(reason, regs);
}

dotraplinkage notrace __kprobes void
Expand Down

0 comments on commit f2fd439

Please sign in to comment.