]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-install-common.c (platforms): Fix the order of entries and
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 16 Nov 2013 23:54:40 +0000 (00:54 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 16 Nov 2013 23:54:40 +0000 (00:54 +0100)
remove useless field val.

ChangeLog
util/grub-install-common.c

index 0814b2b38be0279d31c5102e4219ae76d0130168..3f891a84efd89983ee15cfbf8b110976925803ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-17  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-install-common.c (platforms): Fix the order of entries and
+       remove useless field val.
+
 2013-11-16  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub-install.c: Add new option --no-bootsector to skip
index 75a315d06c64192d3434a017e2ab46baf9b47a7e..c60d2df4fe710754e0eeca1a9d0b2accc1e3fe91 100644 (file)
@@ -585,28 +585,27 @@ copy_locales (const char *dstd)
 
 static struct
 {
-  enum grub_install_plat val;
   const char *cpu;
   const char *platform;
-} platforms[] =
+} platforms[GRUB_INSTALL_PLATFORM_MAX] =
   {
-    { GRUB_INSTALL_PLATFORM_I386_PC,          "i386",    "pc"        },
-    { GRUB_INSTALL_PLATFORM_I386_EFI,         "i386",    "efi"       },
-    { GRUB_INSTALL_PLATFORM_I386_QEMU,        "i386",    "qemu"      },
-    { GRUB_INSTALL_PLATFORM_I386_COREBOOT,    "i386",    "coreboot"  },
-    { GRUB_INSTALL_PLATFORM_I386_MULTIBOOT,   "i386",    "multiboot" },
-    { GRUB_INSTALL_PLATFORM_I386_IEEE1275,    "i386",    "ieee1275"  },
-    { GRUB_INSTALL_PLATFORM_X86_64_EFI,       "x86_64",  "efi"       },
-    { GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON,  "mipsel",  "loongson"  },
-    { GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS, "mipsel",  "qemu_mips" },
-    { GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS,   "mips",    "qemu_mips" },
-    { GRUB_INSTALL_PLATFORM_MIPSEL_ARC,       "mipsel",  "arc"       },
-    { GRUB_INSTALL_PLATFORM_MIPS_ARC,         "mips",    "arc"       },
-    { GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275, "sparc64", "ieee1275"  },
-    { GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275, "powerpc", "ieee1275"  },
-    { GRUB_INSTALL_PLATFORM_IA64_EFI,         "ia64",    "efi"       },
-    { GRUB_INSTALL_PLATFORM_ARM_EFI,          "arm",     "efi"       },
-    { GRUB_INSTALL_PLATFORM_ARM_UBOOT,        "arm",     "uboot"     },
+    [GRUB_INSTALL_PLATFORM_I386_PC] =          { "i386",    "pc"        },
+    [GRUB_INSTALL_PLATFORM_I386_EFI] =         { "i386",    "efi"       },
+    [GRUB_INSTALL_PLATFORM_I386_QEMU] =        { "i386",    "qemu"      },
+    [GRUB_INSTALL_PLATFORM_I386_COREBOOT] =    { "i386",    "coreboot"  },
+    [GRUB_INSTALL_PLATFORM_I386_MULTIBOOT] =   { "i386",    "multiboot" },
+    [GRUB_INSTALL_PLATFORM_I386_IEEE1275] =    { "i386",    "ieee1275"  },
+    [GRUB_INSTALL_PLATFORM_X86_64_EFI] =       { "x86_64",  "efi"       },
+    [GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON] =  { "mipsel",  "loongson"  },
+    [GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS] = { "mipsel",  "qemu_mips" },
+    [GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS] =   { "mips",    "qemu_mips" },
+    [GRUB_INSTALL_PLATFORM_MIPSEL_ARC] =       { "mipsel",  "arc"       },
+    [GRUB_INSTALL_PLATFORM_MIPS_ARC] =         { "mips",    "arc"       },
+    [GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275] = { "sparc64", "ieee1275"  },
+    [GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275] = { "powerpc", "ieee1275"  },
+    [GRUB_INSTALL_PLATFORM_IA64_EFI] =         { "ia64",    "efi"       },
+    [GRUB_INSTALL_PLATFORM_ARM_EFI] =          { "arm",     "efi"       },
+    [GRUB_INSTALL_PLATFORM_ARM_UBOOT] =        { "arm",     "uboot"     },
   }; 
 
 char *
@@ -825,7 +824,7 @@ grub_install_get_target (const char *src)
        && strcmp (platforms[i].platform, pl) == 0)
       {
        free (fn);
-       return platforms[i].val;
+       return i;
       }
   grub_util_error (_("Unknown platform `%s-%s'"), c, pl);
 }