minor code cleanup and policing


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12889 a1c6a512-1295-4272-9138-f99709370657
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index c4000ea..99200da 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -19,6 +19,8 @@
  * KIND, either express or implied.
  *
  ****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
 #include "common.h"
 #include "cpu.h"
 #include "file.h"
@@ -30,7 +32,29 @@
 #include "button.h"
 #include "disk.h"
 #include <string.h>
+#ifdef SANSA_E200
+#include "usb.h"
+#endif
 
+
+/* Button definitions */
+#if CONFIG_KEYPAD == IRIVER_H10_PAD
+#define BOOTLOADER_BOOT_OF      BUTTON_LEFT
+
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define BOOTLOADER_BOOT_OF      BUTTON_LEFT
+
+#endif
+
+/* Maximum allowed firmware image size. 10MB is more than enough */
+#define MAX_LOADSIZE (10*1024*1024)
+
+/* A buffer to load the original firmware or Rockbox into */
+unsigned char *loadbuffer = (unsigned char *)DRAM_START;
+
+/* Bootloader version */
+char version[] = APPSVERSION;
+        
 /* Locations and sizes in hidden partition on Sansa */
 #ifdef SANSA_E200
 #define PPMI_SECTOR_OFFSET  1024
@@ -247,11 +271,7 @@
 
 /* based on implementation by Finn Yannick Jacobs */
 
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef SANSA_E200
-#include "usb.h"
-#endif
+
 
 /* crc_tab[] -- this crcTable is being build by chksum_crc32GenTab().
  *		so make sure, you call it before using the other
@@ -306,23 +326,6 @@
    }
 }
 
-/* Button definitions */
-#if CONFIG_KEYPAD == IRIVER_H10_PAD
-#define BOOTLOADER_BOOT_OF      BUTTON_LEFT
-
-#elif CONFIG_KEYPAD == SANSA_E200_PAD
-#define BOOTLOADER_BOOT_OF      BUTTON_LEFT
-
-#endif
-
-/* Maximum allowed firmware image size. 10MB is more than enough */
-#define MAX_LOADSIZE (10*1024*1024)
-
-/* A buffer to load the original firmware or Rockbox into */
-unsigned char *loadbuffer = (unsigned char *)DRAM_START;
-
-/* Bootloader version */
-char version[] = APPSVERSION;
 
 /* Load mi4 format firmware image */
 int load_mi4(unsigned char* buf, char* firmware, unsigned int buffer_size)
@@ -477,7 +480,8 @@
             sector = pinfo->start + 0x3c5c;
             offset  = 0x2;
         }
-        else return EOK;
+        else 
+            return EOK;
         ata_read_sectors(sector, 1, block);
         block[offset] = 0;
         ata_write_sectors(sector, 1, block);