]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
GHES: Elliminate double-loop in the NMI handler
authorBorislav Petkov <bp@suse.de>
Wed, 18 Mar 2015 09:12:35 +0000 (10:12 +0100)
committerBorislav Petkov <bp@suse.de>
Mon, 27 Apr 2015 19:27:35 +0000 (21:27 +0200)
There's no real need to iterate twice over the HW error sources in the
NMI handler. With the previous cleanups, elliminating the second loop is
almost trivial.

Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/acpi/apei/ghes.c

index 0de3adcca03ef3cca65b248d214c76e1bbb1897a..94a44bad55763f88e86d20e4be137f6c0ec8be3f 100644 (file)
@@ -851,25 +851,18 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
                if (sev >= GHES_SEV_PANIC)
                        __ghes_panic(ghes);
 
-               ret = NMI_HANDLED;
-       }
-
-       if (ret == NMI_DONE)
-               goto out;
-
-       list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
                if (!(ghes->flags & GHES_TO_CLEAR))
                        continue;
 
                __process_error(ghes);
                ghes_clear_estatus(ghes);
+
+               ret = NMI_HANDLED;
        }
 
 #ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
        irq_work_queue(&ghes_proc_irq_work);
 #endif
-
-out:
        raw_spin_unlock(&ghes_nmi_lock);
        return ret;
 }