Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Clean up arch/mips/boot/compressed/decompress.c

- Remove several outdated comments
- Clearify the definition of zimage_start and zimage_size and the their
usage

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1382/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Wu Zhangjin and committed by
Ralf Baechle
1e1a77d6 bdbffd9b

+13 -23
+13 -23
arch/mips/boot/compressed/decompress.c
··· 1 1 /* 2 - * Misc. bootloader code for many machines. 3 - * 4 2 * Copyright 2001 MontaVista Software Inc. 5 - * Author: Matt Porter <mporter@mvista.com> Derived from 6 - * arch/ppc/boot/prep/misc.c 3 + * Author: Matt Porter <mporter@mvista.com> 7 4 * 8 5 * Copyright (C) 2009 Lemote, Inc. 9 6 * Author: Wu Zhangjin <wuzhangjin@gmail.com> ··· 16 19 17 20 #include <asm/addrspace.h> 18 21 19 - /* These two variables specify the free mem region 22 + /* 23 + * These two variables specify the free mem region 20 24 * that can be used for temporary malloc area 21 25 */ 22 26 unsigned long free_mem_ptr; 23 27 unsigned long free_mem_end_ptr; 24 - char *zimage_start; 25 28 26 29 /* The linker tells us where the image is. */ 27 30 extern unsigned char __image_begin, __image_end; ··· 80 83 81 84 void decompress_kernel(unsigned long boot_heap_start) 82 85 { 83 - int zimage_size; 86 + unsigned long zimage_start, zimage_size; 84 87 85 - /* 86 - * We link ourself to an arbitrary low address. When we run, we 87 - * relocate outself to that address. __image_beign points to 88 - * the part of the image where the zImage is. -- Tom 89 - */ 90 - zimage_start = (char *)(unsigned long)(&__image_begin); 88 + zimage_start = (unsigned long)(&__image_begin); 91 89 zimage_size = (unsigned long)(&__image_end) - 92 90 (unsigned long)(&__image_begin); 93 91 94 - /* 95 - * The zImage and initrd will be between start and _end, so they've 96 - * already been moved once. We're good to go now. -- Tom 97 - */ 98 92 puts("zimage at: "); 99 - puthex((unsigned long)zimage_start); 93 + puthex(zimage_start); 100 94 puts(" "); 101 - puthex((unsigned long)(zimage_size + zimage_start)); 95 + puthex(zimage_size + zimage_start); 102 96 puts("\n"); 103 97 104 - /* this area are prepared for mallocing when decompressing */ 98 + /* This area are prepared for mallocing when decompressing */ 105 99 free_mem_ptr = boot_heap_start; 106 100 free_mem_end_ptr = boot_heap_start + BOOT_HEAP_SIZE; 107 101 108 - /* Display standard Linux/MIPS boot prompt for kernel args */ 102 + /* Display standard Linux/MIPS boot prompt */ 109 103 puts("Uncompressing Linux at load address "); 110 104 puthex(VMLINUX_LOAD_ADDRESS_ULL); 111 105 puts("\n"); 106 + 112 107 /* Decompress the kernel with according algorithm */ 113 - decompress(zimage_start, zimage_size, 0, 0, 108 + decompress((char *)zimage_start, zimage_size, 0, 0, 114 109 (void *)VMLINUX_LOAD_ADDRESS_ULL, 0, error); 115 - /* FIXME: is there a need to flush cache here? */ 110 + 111 + /* FIXME: should we flush cache here? */ 116 112 puts("Now, booting the kernel...\n"); 117 113 }