From: Vivek Goyal <[EMAIL PROTECTED]>

o Put the debug code under #ifdef DEBUG instead of #if 0.

o This patch only takes care of x86_64 code. Rest of the arches can slowly
  do similar modification.

Signed-off-by: Vivek Goyal <[EMAIL PROTECTED]>
---

 kexec/arch/x86_64/crashdump-x86_64.c     |   14 +++++++-------
 kexec/arch/x86_64/kexec-elf-rel-x86_64.c |    2 +-
 kexec/arch/x86_64/kexec-x86_64.c         |    4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/kexec/arch/x86_64/crashdump-x86_64.c 
b/kexec/arch/x86_64/crashdump-x86_64.c
index dc499b3..52cb72e 100644
--- a/kexec/arch/x86_64/crashdump-x86_64.c
+++ b/kexec/arch/x86_64/crashdump-x86_64.c
@@ -88,7 +88,7 @@ static int get_crash_memory_ranges(struc
                if (count != 2)
                        continue;
                str = line + consumed;
-#if 0
+#ifdef DEBUG
                printf("%016Lx-%016Lx : %s",
                        start, end, str);
 #endif
@@ -142,7 +142,7 @@ #endif
                return -1;
        *range = crash_memory_range;
        *ranges = memory_ranges;
-#if 0
+#ifdef DEBUG
        int i;
        printf("CRASH MEMORY RANGES\n");
        for(i = 0; i < memory_ranges; i++) {
@@ -243,7 +243,7 @@ static int add_memmap(struct memory_rang
                        memmap_p[j+1] = memmap_p[j];
                memmap_p[tidx].start = addr;
                memmap_p[tidx].end = addr + size - 1;
-#if 0
+#ifdef DEBUG
        printf("Memmap after adding segment\n");
        for (i = 0; i < CRASH_MAX_MEMMAP_NR;  i++) {
                mstart = memmap_p[i].start;
@@ -328,7 +328,7 @@ static int delete_memmap(struct memory_r
                        memmap_p[j-1] = memmap_p[j];
                memmap_p[j-1].start = memmap_p[j-1].end = 0;
        }
-#if 0
+#ifdef DEBUG
        printf("Memmap after deleting segment\n");
        for (i = 0; i < CRASH_MAX_MEMMAP_NR;  i++) {
                mstart = memmap_p[i].start;
@@ -402,7 +402,7 @@ static int cmdline_add_memmap(char *cmdl
                        die("Command line overflow\n");
                strcat(cmdline, str_mmap);
        }
-#if 0
+#ifdef DEBUG
                printf("Command line after adding memmap\n");
                printf("%s\n", cmdline);
 #endif
@@ -430,7 +430,7 @@ static int cmdline_add_elfcorehdr(char *
        if (cmdlen > (COMMAND_LINE_SIZE - 1))
                die("Command line overflow\n");
        strcat(cmdline, str);
-#if 0
+#ifdef DEBUG
                printf("Command line after adding elfcorehdr\n");
                printf("%s\n", cmdline);
 #endif
@@ -463,7 +463,7 @@ static int cmdline_add_memmap_acpi(char 
                die("Command line overflow\n");
        strcat(cmdline, str_mmap);
 
-#if 0
+#ifdef DEBUG
                printf("Command line after adding acpi memmap\n");
                printf("%s\n", cmdline);
 #endif
diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c 
b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
index afcb171..16b32a2 100644
--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
@@ -60,7 +60,7 @@ static const char *reloc_name(unsigned l
 void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, 
        void *location, unsigned long address, unsigned long value)
 {
-#if 0
+#ifdef DEBUG
        fprintf(stderr, "%s\n", reloc_name(r_type));
 #endif
        switch(r_type) {
diff --git a/kexec/arch/x86_64/kexec-x86_64.c b/kexec/arch/x86_64/kexec-x86_64.c
index fbef9e7..528cd8a 100644
--- a/kexec/arch/x86_64/kexec-x86_64.c
+++ b/kexec/arch/x86_64/kexec-x86_64.c
@@ -64,7 +64,7 @@ int get_memory_ranges(struct memory_rang
                        continue;
                str = line + consumed;
                end = end + 1;
-#if 0
+#ifdef DEBUG
                printf("%016Lx-%016Lx : %s",
                        start, end, str);
 #endif
@@ -104,7 +104,7 @@ #endif
                memory_range[memory_ranges].start = start;
                memory_range[memory_ranges].end = end;
                memory_range[memory_ranges].type = type;
-#if 0
+#ifdef DEBUG
                printf("%016Lx-%016Lx : %x\n",
                        start, end, type);
 #endif
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to