static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       struct boot_device_info *table;
-       u32 mode_sel, n = 0;
-
-       mode_sel = get_boot_mode_sel();
+       int mode_sel, i;
 
        printf("Boot Swap: %s\n\n", boot_is_swapped() ? "ON" : "OFF");
 
+       mode_sel = get_boot_mode_sel();
+
        puts("Boot Mode Pin:\n");
 
-       for (table = boot_device_table; strlen(table->info); table++) {
-               printf(" %c %02x %s\n", n == mode_sel ? '*' : ' ', n,
-                      table->info);
-               n++;
-       }
+       for (i = 0; strlen(boot_device_table[i].info); i++)
+               printf(" %c %02x %s\n", i == mode_sel ? '*' : ' ', i,
+                      boot_device_table[i].info);
 
        return 0;
 }
 
        {BOOT_DEVICE_NONE, ""}
 };
 
-u32 get_boot_mode_sel(void)
+int get_boot_mode_sel(void)
 {
        return (readl(SG_PINMON0) >> 1) & 0x1f;
 }
 
 u32 spl_boot_device(void)
 {
-       u32 boot_mode;
+       int boot_mode;
 
        if (boot_is_swapped())
                return BOOT_DEVICE_NOR;
 
 #ifndef _ASM_BOOT_DEVICE_H_
 #define _ASM_BOOT_DEVICE_H_
 
-u32 get_boot_mode_sel(void);
+int get_boot_mode_sel(void);
 
 struct boot_device_info {
        u32 type;