All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: kexec@lists.infradead.org
Subject: use dprintf
Date: Tue, 8 May 2007 15:12:05 +0900	[thread overview]
Message-ID: <20070508061204.GD8170@verge.net.au> (raw)
In-Reply-To: <463FBE27.4060402@am.sony.com>

Use the new fprintf macro where possible

Cc: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Simon Horman <horms@verge.net.au>

--- 
 kexec/arch/i386/crashdump-x86.c   |    5 ++---
 kexec/arch/i386/kexec-bzImage.c   |    9 ++++-----
 kexec/arch/i386/x86-linux-setup.c |    6 +++---
 kexec/crashdump-elf.c             |   30 ++++++++++++++----------------
 4 files changed, 23 insertions(+), 27 deletions(-)

Index: kexec-tools-testing-geoff-levand/kexec/arch/i386/crashdump-x86.c
===================================================================
--- kexec-tools-testing-geoff-levand.orig/kexec/arch/i386/crashdump-x86.c	2007-05-08 12:08:53.000000000 +0900
+++ kexec-tools-testing-geoff-levand/kexec/arch/i386/crashdump-x86.c	2007-05-08 12:10:58.000000000 +0900
@@ -515,8 +515,7 @@ int load_crashdump_segments(struct kexec
 	memset(tmp, 0, sz);
 	info->backup_start = add_buffer(info, tmp, sz, sz, align,
 				0, max_addr, -1);
-	dfprintf(stdout, "Created backup segment at 0x%lx\n",
-				info->backup_start);
+	dprintf("Created backup segment at 0x%lx\n", info->backup_start);
 	if (delete_memmap(memmap_p, info->backup_start, sz) < 0)
 		return -1;
 
@@ -545,7 +544,7 @@ int load_crashdump_segments(struct kexec
 	 */
 	elfcorehdr = add_buffer(info, tmp, sz, 16*1024, align, min_base,
 							max_addr, -1);
-	dfprintf(stdout, "Created elf header segment at 0x%lx\n", elfcorehdr);
+	dprintf("Created elf header segment at 0x%lx\n", elfcorehdr);
 	if (delete_memmap(memmap_p, elfcorehdr, sz) < 0)
 		return -1;
 	cmdline_add_memmap(mod_cmdline, memmap_p);
Index: kexec-tools-testing-geoff-levand/kexec/arch/i386/kexec-bzImage.c
===================================================================
--- kexec-tools-testing-geoff-levand.orig/kexec/arch/i386/kexec-bzImage.c	2007-05-08 12:08:53.000000000 +0900
+++ kexec-tools-testing-geoff-levand/kexec/arch/i386/kexec-bzImage.c	2007-05-08 12:10:58.000000000 +0900
@@ -136,7 +136,7 @@ int do_bzImage_load(struct kexec_info *i
 
 	if (setup_header.protocol_version >= 0x0205) {
 		relocatable_kernel = setup_header.relocatable_kernel;
-		dfprintf(stdout, "bzImage is relocatable\n");
+		dprintf("bzImage is relocatable\n");
 	}
 
 	/* Can't use bzImage for crash dump purposes with real mode entry */
@@ -192,8 +192,7 @@ int do_bzImage_load(struct kexec_info *i
 	else
 		elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size,
 					0x3000, 640*1024, -1, 0);
-	dfprintf(stdout, "Loaded purgatory at addr 0x%lx\n",
-				info->rhdr.rel_addr);
+	dprintf("Loaded purgatory at addr 0x%lx\n", info->rhdr.rel_addr);
 	/* The argument/parameter segment */
 	setup_size = kern16_size + command_line_len;
 	real_mode = xmalloc(setup_size);
@@ -215,7 +214,7 @@ int do_bzImage_load(struct kexec_info *i
 		add_segment(info, real_mode, setup_size, SETUP_BASE, setup_size);
 		setup_base = SETUP_BASE;
 	}
-	dfprintf(stdout, "Loaded real-mode code and command line at 0x%lx\n",
+	dprintf("Loaded real-mode code and command line at 0x%lx\n",
 			setup_base);
 
 	/* Verify purgatory loads higher than the parameters */
@@ -247,7 +246,7 @@ int do_bzImage_load(struct kexec_info *i
 				kernel32_load_addr, size);
 	}
 		
-	dfprintf(stdout, "Loaded 32bit kernel at 0x%lx\n", kernel32_load_addr);
+	dprintf("Loaded 32bit kernel at 0x%lx\n", kernel32_load_addr);
 
 	/* Tell the kernel what is going on */
 	setup_linux_bootloader_parameters(info, real_mode, setup_base,
Index: kexec-tools-testing-geoff-levand/kexec/arch/i386/x86-linux-setup.c
===================================================================
--- kexec-tools-testing-geoff-levand.orig/kexec/arch/i386/x86-linux-setup.c	2007-05-08 12:08:53.000000000 +0900
+++ kexec-tools-testing-geoff-levand/kexec/arch/i386/x86-linux-setup.c	2007-05-08 12:10:58.000000000 +0900
@@ -61,7 +61,7 @@ void setup_linux_bootloader_parameters(
 	initrd_addr_max = DEFAULT_INITRD_ADDR_MAX;
 	if (real_mode->protocol_version >= 0x0203) {
 		initrd_addr_max = real_mode->initrd_addr_max;
-		dfprintf(stdout, "initrd_addr_max is 0x%lx\n", initrd_addr_max);
+		dprintf("initrd_addr_max is 0x%lx\n", initrd_addr_max);
 	}
 
 	/* Load the initrd if we have one */
@@ -69,8 +69,8 @@ void setup_linux_bootloader_parameters(
 		initrd_base = add_buffer(info,
 			initrd_buf, initrd_size, initrd_size,
 			4096, INITRD_BASE, initrd_addr_max, -1);
-		dfprintf(stdout, "Loaded initrd at 0x%lx size 0x%lx\n",
-					initrd_base, initrd_size);
+		dprintf("Loaded initrd at 0x%lx size 0x%lx\n", initrd_base,
+			initrd_size);
 	} else {
 		initrd_base = 0;
 		initrd_size = 0;
Index: kexec-tools-testing-geoff-levand/kexec/crashdump-elf.c
===================================================================
--- kexec-tools-testing-geoff-levand.orig/kexec/crashdump-elf.c	2007-05-08 12:08:53.000000000 +0900
+++ kexec-tools-testing-geoff-levand/kexec/crashdump-elf.c	2007-05-08 12:12:03.000000000 +0900
@@ -4,22 +4,20 @@
 #endif
 
 #if (ELF_WIDTH == 64)
-#define dfprintf_phdr(fh, prefix, phdr)					\
+#define dprintf_phdr(prefix, phdr)					\
 do {									\
-	dfprintf((fh),							\
-		 "%s: p_type = %u, p_offset = 0x%lx p_paddr = 0x%lx "	\
-		 "p_vaddr = 0x%lx p_filesz = 0x%lx p_memsz = 0x%lx\n",	\
-		 (prefix), (phdr)->p_type, (phdr)->p_offset, (phdr)->p_paddr, \
-		 (phdr)->p_vaddr, (phdr)->p_filesz, (phdr)->p_memsz);	\
+	dprintf("%s: p_type = %u, p_offset = 0x%lx p_paddr = 0x%lx "	\
+		"p_vaddr = 0x%lx p_filesz = 0x%lx p_memsz = 0x%lx\n",	\
+		(prefix), (phdr)->p_type, (phdr)->p_offset, (phdr)->p_paddr, \
+		(phdr)->p_vaddr, (phdr)->p_filesz, (phdr)->p_memsz);	\
 } while(0)
 #else
-#define dfprintf_phdr(fh, prefix, phdr)					\
+#define dprintf_phdr(prefix, phdr)					\
 do {									\
-	dfprintf((fh),							\
-		 "%s: p_type = %u, p_offset = 0x%x " "p_paddr = 0x%x "	\
-		 "p_vaddr = 0x%x p_filesz = 0x%x p_memsz = 0x%x\n",	\
-		 (prefix), (phdr)->p_type, (phdr)->p_offset, (phdr)->p_paddr, \
-		 (phdr)->p_vaddr, (phdr)->p_filesz, (phdr)->p_memsz);	\
+	dprintf("%s: p_type = %u, p_offset = 0x%x " "p_paddr = 0x%x "	\
+		"p_vaddr = 0x%x p_filesz = 0x%x p_memsz = 0x%x\n",	\
+		(prefix), (phdr)->p_type, (phdr)->p_offset, (phdr)->p_paddr, \
+		(phdr)->p_vaddr, (phdr)->p_filesz, (phdr)->p_memsz);	\
 } while(0)
 #endif
 
@@ -145,7 +143,7 @@ int FUNC(struct kexec_info *info,
 
 		/* Increment number of program headers. */
 		(elf->e_phnum)++;
-		dfprintf_phdr(stdout, "Elf header", phdr);
+		dprintf_phdr("Elf header", phdr);
 	}
 
 	/* Setup an PT_LOAD type program header for the region where
@@ -162,7 +160,7 @@ int FUNC(struct kexec_info *info,
 		phdr->p_filesz	= phdr->p_memsz	= info->kern_size;
 		phdr->p_align	= 0;
 		(elf->e_phnum)++;
-		dfprintf_phdr(stdout, "Kernel text Elf header", phdr);
+		dprintf_phdr("Kernel text Elf header", phdr);
 	}
 
 	/* Setup PT_LOAD type program header for every system RAM chunk.
@@ -203,9 +201,9 @@ int FUNC(struct kexec_info *info,
 
 		/* Increment number of program headers. */
 		(elf->e_phnum)++;
-		dfprintf_phdr(stdout, "Elf header", phdr);
+		dprintf_phdr("Elf header", phdr);
 	}
 	return 0;
 }
 
-#undef dfprintf_phdr
+#undef dprintf_phdr

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  parent reply	other threads:[~2007-05-08  6:12 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070507235727.631477448@am.sony.com>
2007-05-08  0:02 ` [patch 1/5] kexec debug output improvments Geoff Levand
2007-05-08  6:08   ` Simon Horman
2007-05-08 14:40     ` Geoff Levand
2007-05-09  6:47       ` Simon Horman
2007-05-08  6:12   ` Simon Horman [this message]
2007-05-09 21:40     ` [patch 1/2] kexec remove last remaining dfprintf Geoff Levand
2007-05-10  2:13       ` Simon Horman
2007-05-10  2:55         ` Simon Horman
2007-05-09 21:40     ` [patch 2/2] kexec rename dprintf to dbgprintf Geoff Levand
2007-05-10  2:14       ` Simon Horman
2007-05-10  2:55         ` Simon Horman
2007-05-10 22:10           ` kexec and kdb Preetesh Parekh
2007-05-11  4:23             ` Vivek Goyal
2007-05-14 23:20               ` Preetesh Parekh
2007-05-15  7:54                 ` Vivek Goyal
2007-05-16 17:45                   ` Preetesh Parekh
2007-05-08  6:20   ` [patch 1/5] kexec debug output improvments Vivek Goyal
2007-05-08  7:24     ` Simon Horman
2007-05-08 14:36     ` Geoff Levand
2007-05-08 16:02       ` Vivek Goyal
2007-05-09  1:11         ` Geoff Levand
2007-05-09  4:19           ` Vivek Goyal
2007-05-08  0:02 ` [patch 2/5] kexec improve build for ppc64 Geoff Levand
2007-05-08  6:07   ` Simon Horman
2007-05-08  0:02 ` [patch 3/5] kexec add strict-prototypes Geoff Levand
2007-05-08  2:38   ` Simon Horman
2007-05-08 14:56     ` Geoff Levand
2007-05-09  0:33     ` [patch 1/2] " Geoff Levand
2007-05-09  6:48       ` Simon Horman
2007-05-09  0:33     ` [patch 2/2] kexec fix prototypes for ppc64 Geoff Levand
2007-05-09  6:48       ` Simon Horman
2007-05-08  0:03 ` [patch 4/5] Add proper node alignment for the powerpc device-tree cmdline Geoff Levand
2007-05-08  6:13   ` Simon Horman
2007-05-08 14:50     ` Milton Miller
2007-05-08  0:03 ` [patch 5/5] kexec fix ppc64 device-tree mem node Geoff Levand
2007-05-08  6:14   ` Simon Horman
2007-05-08 14:57     ` Spam:****, " Milton Miller
2007-05-08  6:35   ` Mohan Kumar M
2007-05-08  8:20     ` David Woodhouse
2007-05-09  2:39   ` [patch v2] " Geoff Levand
2007-05-09 22:35     ` [patch v3] " Geoff Levand
2007-05-14 19:08       ` Geoff Levand
2007-05-15  4:38         ` Simon Horman

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=20070508061204.GD8170@verge.net.au \
    --to=horms@verge.net.au \
    --cc=geoffrey.levand@am.sony.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.