[PATCH 3/5] arm: move DEBUG code to --debug

Cong Wang xiyou.wangcong at gmail.com
Thu Mar 8 01:39:40 EST 2012


Like patch 1/5, this one moves code under #if DEBUG to --debug
on arm arch.

Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
---
 kexec/arch/arm/crashdump-arm.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
index e9b22bf..213dae2 100644
--- a/kexec/arch/arm/crashdump-arm.c
+++ b/kexec/arch/arm/crashdump-arm.c
@@ -219,7 +219,6 @@ static void cmdline_add_mem(char *cmdline, unsigned long size)
 	cmdline[COMMAND_LINE_SIZE - 1] = '\0';
 }
 
-#ifdef DEBUG
 static unsigned long long range_size(const struct memory_range *r)
 {
 	return r->end - r->start + 1;
@@ -229,6 +228,9 @@ static void dump_memory_ranges(void)
 {
 	int i;
 
+	if (!kexec_debug)
+		return;
+
 	dbgprintf("crashkernel: [%#llx - %#llx] (%ldM)\n",
 		  crash_reserved_mem.start, crash_reserved_mem.end,
 		  (unsigned long)range_size(&crash_reserved_mem) >> 20);
@@ -239,9 +241,6 @@ static void dump_memory_ranges(void)
 			  r->start, r->end, (unsigned long)range_size(r) >> 20);
 	}
 }
-#else
-static inline void dump_memory_ranges(void) {}
-#endif
 
 /**
  * load_crashdump_segments() - loads additional segments needed for kdump
-- 
1.7.7.6




More information about the kexec mailing list