Skip to contentSkip to conversation

kexec: debug: Use dbgprintf() instead of #ifdef DEBUG

PATCH New Zhang Yanfei 1 participant 1 message Mar 20, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: debug: Use dbgprintf() instead of #ifdef DEBUG

From: Zhang Yanfei <[email protected]>

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().

---
 kexec/arch/i386/crashdump-x86.c    |    6 ++----
 kexec/arch/ppc64/crashdump-ppc64.c |   12 +++---------
 2 files changed, 5 insertions(+), 13 deletions(-)
kexec/arch/i386/crashdump-x86.c +2 -4
index 5462f8b..31748c2 100644
@@ -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;
 }
 
kexec/arch/ppc64/crashdump-ppc64.c +3 -9
index 49cab12..6b2eb4c 100644
@@ -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;
 			}
 		}
Signature · 6 lines
1.7.1

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec