]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/hostdisk.c (read_device_map): Remove nested
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 1 Mar 2013 12:46:24 +0000 (13:46 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 1 Mar 2013 12:46:24 +0000 (13:46 +0100)
function.

ChangeLog
grub-core/kern/emu/hostdisk.c

index fda449dae5160cab28907a4cff8c9e18d7533748..f324b9216d4eb757074418caceab333e5d27a2ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-01  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/emu/hostdisk.c (read_device_map): Remove nested
+       function.
+
 2013-03-01  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/gentrigtables.c: Make tables const.
index 92ce1d9fb0149de30a309530ee4e1ff731855bdf..62a579bddbd9bb75cd9e6f0c4c5fffd55b8886c3 100644 (file)
@@ -1209,13 +1209,6 @@ read_device_map (const char *dev_map)
   int lineno = 0;
   struct stat st;
 
-  auto void show_error (const char *msg)
-    __attribute__ ((noreturn));
-  void __attribute__ ((noreturn)) show_error (const char *msg)
-    {
-      grub_util_error ("%s:%d: %s", dev_map, lineno, msg);
-    }
-
   if (dev_map[0] == '\0')
     {
       grub_util_info ("no device.map");
@@ -1250,14 +1243,14 @@ read_device_map (const char *dev_map)
        {
          char *tmp;
          tmp = xasprintf (_("missing `%c' symbol"), '(');
-         show_error (tmp);
+         grub_util_error ("%s:%d: %s", dev_map, lineno, tmp);
        }
 
       p++;
       /* Find a free slot.  */
       drive = find_free_slot ();
       if (drive < 0)
-       show_error (_("device count exceeds limit"));
+       grub_util_error ("%s:%d: %s", dev_map, lineno, _("device count exceeds limit"));
 
       e = p;
       p = strchr (p, ')');
@@ -1265,7 +1258,7 @@ read_device_map (const char *dev_map)
        {
          char *tmp;
          tmp = xasprintf (_("missing `%c' symbol"), ')');
-         show_error (tmp);
+         grub_util_error ("%s:%d: %s", dev_map, lineno, tmp);
        }
 
       map[drive].drive = 0;
@@ -1310,7 +1303,7 @@ read_device_map (const char *dev_map)
        p++;
 
       if (*p == '\0')
-       show_error (_("filename expected"));
+       grub_util_error ("%s:%d: %s", dev_map, lineno, _("filename expected"));
 
       /* NUL-terminate the filename.  */
       e = p;