From: Zhang Yanfei <zhangyanfei.yes@gmail.com>
To: Simon Horman <horms@verge.net.au>
Cc: "kexec@lists.infradead.org" <kexec@lists.infradead.org>
Subject: [PATCH] kexec: debug: Use dbgprintf() instead of #ifdef DEBUG
Date: Wed, 20 Mar 2013 21:14:52 +0800 [thread overview]
Message-ID: <5149B64C.7050405@gmail.com> (raw)
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
reply other threads:[~2013-03-20 13:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5149B64C.7050405@gmail.com \
--to=zhangyanfei.yes@gmail.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox