* [PATCH] kexec: debug: Use dbgprintf() instead of #ifdef DEBUG
@ 2013-03-20 13:14 Zhang Yanfei
0 siblings, 0 replies; only message in thread
From: Zhang Yanfei @ 2013-03-20 13:14 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec@lists.infradead.org
From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
When use -d option, dbgprintf() will be used to print the debug info.
And we don't have a DEBUG definition, so replace #ifdef DEBUG test
with dbgprinf().
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
---
kexec/arch/i386/crashdump-x86.c | 6 ++----
kexec/arch/ppc64/crashdump-ppc64.c | 12 +++---------
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 5462f8b..31748c2 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -929,10 +929,8 @@ static int cmdline_add_memmap_reserved(char *cmdline, unsigned long start,
die("Command line overflow\n");
strcat(cmdline, str_mmap);
-#ifdef DEBUG
- printf("Command line after adding reserved memmap\n");
- printf("%s\n", cmdline);
-#endif
+ dbgprintf("Command line after adding reserved memmap\n");
+ dbgprintf("%s\n", cmdline);
return 0;
}
diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
index 49cab12..6b2eb4c 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -472,24 +472,18 @@ void add_usable_mem_rgns(unsigned long long base, unsigned long long size)
if (base < ustart && end > uend) {
usablemem_rgns.ranges[i].start = base;
usablemem_rgns.ranges[i].end = end;
-#ifdef DEBUG
- fprintf(stderr, "usable memory rgn %u: new base:%llx new size:%llx\n",
+ dbgprintf("usable memory rgn %u: new base:%llx new size:%llx\n",
i, base, size);
-#endif
return;
} else if (base < ustart) {
usablemem_rgns.ranges[i].start = base;
-#ifdef DEBUG
- fprintf(stderr, "usable memory rgn %u: new base:%llx new size:%llx",
+ dbgprintf("usable memory rgn %u: new base:%llx new size:%llx",
i, base, usablemem_rgns.ranges[i].end - base);
-#endif
return;
} else if (end > uend){
usablemem_rgns.ranges[i].end = end;
-#ifdef DEBUG
- fprintf(stderr, "usable memory rgn %u: new end:%llx, new size:%llx",
+ dbgprintf("usable memory rgn %u: new end:%llx, new size:%llx",
i, end, end - usablemem_rgns.ranges[i].start);
-#endif
return;
}
}
--
1.7.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-03-20 13:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 13:14 [PATCH] kexec: debug: Use dbgprintf() instead of #ifdef DEBUG Zhang Yanfei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox