Skip to content

Commit 1e1a77d

Browse files
lzufalconralfbaechle
authored andcommitted
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>
1 parent bdbffd9 commit 1e1a77d

1 file changed

Lines changed: 14 additions & 24 deletions

File tree

‎arch/mips/boot/compressed/decompress.c‎

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/*
2-
* Misc. bootloader code for many machines.
3-
*
42
* 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>
74
*
85
* Copyright (C) 2009 Lemote, Inc.
96
* Author: Wu Zhangjin <wuzhangjin@gmail.com>
@@ -19,12 +16,12 @@
1916

2017
#include <asm/addrspace.h>
2118

22-
/* These two variables specify the free mem region
19+
/*
20+
* These two variables specify the free mem region
2321
* that can be used for temporary malloc area
2422
*/
2523
unsigned long free_mem_ptr;
2624
unsigned long free_mem_end_ptr;
27-
char *zimage_start;
2825

2926
/* The linker tells us where the image is. */
3027
extern unsigned char __image_begin, __image_end;
@@ -83,38 +80,31 @@ void *memset(void *s, int c, size_t n)
8380

8481
void decompress_kernel(unsigned long boot_heap_start)
8582
{
86-
int zimage_size;
87-
88-
/*
89-
* We link ourself to an arbitrary low address. When we run, we
90-
* relocate outself to that address. __image_beign points to
91-
* the part of the image where the zImage is. -- Tom
92-
*/
93-
zimage_start = (char *)(unsigned long)(&__image_begin);
83+
unsigned long zimage_start, zimage_size;
84+
85+
zimage_start = (unsigned long)(&__image_begin);
9486
zimage_size = (unsigned long)(&__image_end) -
9587
(unsigned long)(&__image_begin);
9688

97-
/*
98-
* The zImage and initrd will be between start and _end, so they've
99-
* already been moved once. We're good to go now. -- Tom
100-
*/
10189
puts("zimage at: ");
102-
puthex((unsigned long)zimage_start);
90+
puthex(zimage_start);
10391
puts(" ");
104-
puthex((unsigned long)(zimage_size + zimage_start));
92+
puthex(zimage_size + zimage_start);
10593
puts("\n");
10694

107-
/* this area are prepared for mallocing when decompressing */
95+
/* This area are prepared for mallocing when decompressing */
10896
free_mem_ptr = boot_heap_start;
10997
free_mem_end_ptr = boot_heap_start + BOOT_HEAP_SIZE;
11098

111-
/* Display standard Linux/MIPS boot prompt for kernel args */
99+
/* Display standard Linux/MIPS boot prompt */
112100
puts("Uncompressing Linux at load address ");
113101
puthex(VMLINUX_LOAD_ADDRESS_ULL);
114102
puts("\n");
103+
115104
/* Decompress the kernel with according algorithm */
116-
decompress(zimage_start, zimage_size, 0, 0,
105+
decompress((char *)zimage_start, zimage_size, 0, 0,
117106
(void *)VMLINUX_LOAD_ADDRESS_ULL, 0, error);
118-
/* FIXME: is there a need to flush cache here? */
107+
108+
/* FIXME: should we flush cache here? */
119109
puts("Now, booting the kernel...\n");
120110
}

0 commit comments

Comments
 (0)