Skip to contentSkip to conversation

ia64: simplify notify hooks in mca.c

PATCH New Hidetoshi Seto 1 participant 1 message Apr 17, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ia64: simplify notify hooks in mca.c

(this patch is made against tony's git/test tree)

There are many notify_die() and almost all take same style with ia64_mca_spin(). This patch defines macros and replace them all, to reduce lines and to improve readability.

---
 arch/ia64/kernel/crash.c |    4 +-
 arch/ia64/kernel/mca.c   |   74 +++++++++++++++++++++------------------------
 include/asm-ia64/mca.h   |    1 +
 3 files changed, 38 insertions(+), 41 deletions(-)
arch/ia64/kernel/crash.c +2 -2
index e74e15a..83233a2 100644
@@ -193,8 +193,8 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
 			unw_init_running(kdump_cpu_freeze, NULL);
 		break;
 	case DIE_MCA_MONARCH_LEAVE:
-		/* die_register->signr indicate if MCA is recoverable */
-		if (kdump_on_fatal_mca && !args->signr) {
+		/* *(nd->data) indicate if MCA is recoverable */
+		if (kdump_on_fatal_mca && !(*(nd->data))) {
 			atomic_set(&kdump_in_progress, 1);
 			*(nd->monarch_cpu) = -1;
 			machine_kdump_on_init();
arch/ia64/kernel/mca.c +35 -38

151 lines not on this page · raw message

include/asm-ia64/mca.h +1 -0
index f1663aa..18a4321 100644
@@ -157,6 +157,7 @@ extern void ia64_mca_printk(const char * fmt, ...)
 struct ia64_mca_notify_die {
 	struct ia64_sal_os_state *sos;
 	int *monarch_cpu;
+	int *data;
 };
 
 DECLARE_PER_CPU(u64, ia64_mca_pal_base);