diff options
author | Joe Millenbach <jmillenbach@gmail.com> | 2012-07-19 21:04:37 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-07-21 14:07:18 -0400 |
commit | e605a425975b073aafebbb2c09d3ae266be2fd3e (patch) | |
tree | edbd4b8fb189d970b1c7b296540aba9ccb873f73 /arch/x86/boot/compressed/misc.c | |
parent | 9f4e4392cbf72d731a489a3217fe810820b8ba96 (diff) |
x86, boot: Wrap debug printing in a new debug_putstr function
Change all instances of if (debug) putstr(...) to a new debug_putstr(...).
This allows a future change to conditionally stub out debug_putstr to save
space.
Signed-off-by: Joe Millenbach <jmillenbach@gmail.com>
Link: http://lkml.kernel.org/r/1342746282-28497-3-git-send-email-jmillenbach@gmail.com
Signed-off-by: Gokul Caushik <caushik1@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/boot/compressed/misc.c')
-rw-r--r-- | arch/x86/boot/compressed/misc.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c index 8f2355d5858a..49c6d5632ef7 100644 --- a/arch/x86/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc.c | |||
@@ -223,6 +223,12 @@ void __putstr(int error, const char *s) | |||
223 | outb(0xff & (pos >> 1), vidport+1); | 223 | outb(0xff & (pos >> 1), vidport+1); |
224 | } | 224 | } |
225 | 225 | ||
226 | static void debug_putstr(const char *s) | ||
227 | { | ||
228 | if (debug) | ||
229 | putstr(s); | ||
230 | } | ||
231 | |||
226 | void *memset(void *s, int c, size_t n) | 232 | void *memset(void *s, int c, size_t n) |
227 | { | 233 | { |
228 | int i; | 234 | int i; |
@@ -293,8 +299,7 @@ static void parse_elf(void *output) | |||
293 | return; | 299 | return; |
294 | } | 300 | } |
295 | 301 | ||
296 | if (debug) | 302 | debug_putstr("Parsing ELF... "); |
297 | putstr("Parsing ELF... "); | ||
298 | 303 | ||
299 | phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); | 304 | phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); |
300 | if (!phdrs) | 305 | if (!phdrs) |
@@ -346,8 +351,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, | |||
346 | cols = real_mode->screen_info.orig_video_cols; | 351 | cols = real_mode->screen_info.orig_video_cols; |
347 | 352 | ||
348 | console_init(); | 353 | console_init(); |
349 | if (debug) | 354 | debug_putstr("early console in decompress_kernel\n"); |
350 | putstr("early console in decompress_kernel\n"); | ||
351 | 355 | ||
352 | free_mem_ptr = heap; /* Heap */ | 356 | free_mem_ptr = heap; /* Heap */ |
353 | free_mem_end_ptr = heap + BOOT_HEAP_SIZE; | 357 | free_mem_end_ptr = heap + BOOT_HEAP_SIZE; |
@@ -366,11 +370,9 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, | |||
366 | error("Wrong destination address"); | 370 | error("Wrong destination address"); |
367 | #endif | 371 | #endif |
368 | 372 | ||
369 | if (debug) | 373 | debug_putstr("\nDecompressing Linux... "); |
370 | putstr("\nDecompressing Linux... "); | ||
371 | decompress(input_data, input_len, NULL, NULL, output, NULL, error); | 374 | decompress(input_data, input_len, NULL, NULL, output, NULL, error); |
372 | parse_elf(output); | 375 | parse_elf(output); |
373 | if (debug) | 376 | debug_putstr("done.\nBooting the kernel.\n"); |
374 | putstr("done.\nBooting the kernel.\n"); | ||
375 | return; | 377 | return; |
376 | } | 378 | } |