MIPS: Clean up arch/mips/boot/compressed/decompress.c
authorWu Zhangjin <wuzhangjin@gmail.com>
Wed, 16 Jun 2010 07:52:20 +0000 (15:52 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 5 Aug 2010 12:26:32 +0000 (13:26 +0100)
- 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>
arch/mips/boot/compressed/decompress.c

index 5db43c58b1bf7e844eeaa683d3a61d45c0ea340a..5cad0faefa17cdcd7425eb07e93e48554cc99f2f 100644 (file)
@@ -1,9 +1,6 @@
 /*
 /*
- * Misc. bootloader code for many machines.
- *
  * Copyright 2001 MontaVista Software Inc.
  * Copyright 2001 MontaVista Software Inc.
- * Author: Matt Porter <mporter@mvista.com> Derived from
- * arch/ppc/boot/prep/misc.c
+ * Author: Matt Porter <mporter@mvista.com>
  *
  * Copyright (C) 2009 Lemote, Inc.
  * Author: Wu Zhangjin <wuzhangjin@gmail.com>
  *
  * Copyright (C) 2009 Lemote, Inc.
  * Author: Wu Zhangjin <wuzhangjin@gmail.com>
 
 #include <asm/addrspace.h>
 
 
 #include <asm/addrspace.h>
 
-/* These two variables specify the free mem region
+/*
+ * These two variables specify the free mem region
  * that can be used for temporary malloc area
  */
 unsigned long free_mem_ptr;
 unsigned long free_mem_end_ptr;
  * that can be used for temporary malloc area
  */
 unsigned long free_mem_ptr;
 unsigned long free_mem_end_ptr;
-char *zimage_start;
 
 /* The linker tells us where the image is. */
 extern unsigned char __image_begin, __image_end;
 
 /* The linker tells us where the image is. */
 extern unsigned char __image_begin, __image_end;
@@ -83,38 +80,31 @@ void *memset(void *s, int c, size_t n)
 
 void decompress_kernel(unsigned long boot_heap_start)
 {
 
 void decompress_kernel(unsigned long boot_heap_start)
 {
-       int zimage_size;
-
-       /*
-        * We link ourself to an arbitrary low address.  When we run, we
-        * relocate outself to that address.  __image_beign points to
-        * the part of the image where the zImage is. -- Tom
-        */
-       zimage_start = (char *)(unsigned long)(&__image_begin);
+       unsigned long zimage_start, zimage_size;
+
+       zimage_start = (unsigned long)(&__image_begin);
        zimage_size = (unsigned long)(&__image_end) -
            (unsigned long)(&__image_begin);
 
        zimage_size = (unsigned long)(&__image_end) -
            (unsigned long)(&__image_begin);
 
-       /*
-        * The zImage and initrd will be between start and _end, so they've
-        * already been moved once.  We're good to go now. -- Tom
-        */
        puts("zimage at:     ");
        puts("zimage at:     ");
-       puthex((unsigned long)zimage_start);
+       puthex(zimage_start);
        puts(" ");
        puts(" ");
-       puthex((unsigned long)(zimage_size + zimage_start));
+       puthex(zimage_size + zimage_start);
        puts("\n");
 
        puts("\n");
 
-       /* this area are prepared for mallocing when decompressing */
+       /* This area are prepared for mallocing when decompressing */
        free_mem_ptr = boot_heap_start;
        free_mem_end_ptr = boot_heap_start + BOOT_HEAP_SIZE;
 
        free_mem_ptr = boot_heap_start;
        free_mem_end_ptr = boot_heap_start + BOOT_HEAP_SIZE;
 
-       /* Display standard Linux/MIPS boot prompt for kernel args */
+       /* Display standard Linux/MIPS boot prompt */
        puts("Uncompressing Linux at load address ");
        puthex(VMLINUX_LOAD_ADDRESS_ULL);
        puts("\n");
        puts("Uncompressing Linux at load address ");
        puthex(VMLINUX_LOAD_ADDRESS_ULL);
        puts("\n");
+
        /* Decompress the kernel with according algorithm */
        /* Decompress the kernel with according algorithm */
-       decompress(zimage_start, zimage_size, 0, 0,
+       decompress((char *)zimage_start, zimage_size, 0, 0,
                   (void *)VMLINUX_LOAD_ADDRESS_ULL, 0, error);
                   (void *)VMLINUX_LOAD_ADDRESS_ULL, 0, error);
-       /* FIXME: is there a need to flush cache here? */
+
+       /* FIXME: should we flush cache here? */
        puts("Now, booting the kernel...\n");
 }
        puts("Now, booting the kernel...\n");
 }