]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-02-23 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Sat, 23 Feb 2008 20:33:32 +0000 (20:33 +0000)
committerrobertmh <robertmh@localhost>
Sat, 23 Feb 2008 20:33:32 +0000 (20:33 +0000)
        * partmap/gpt.c (grub_gpt_magic): Add `0x' qualifier to each member,
        since they were intended to be in hex.  This didn't break previously
        because of a bug in gpt_partition_map_iterate() (see below).

        (gpt_partition_map_iterate): Replace `grub_memcmp' with `! grub_memcmp'
        when checking the validity of GPT header.
        Remove `partno', since it always provides the same information as `i'.

ChangeLog
partmap/gpt.c

index 333383f37f362f1f3d1b6ceda5141382a771918a..3f8c3b4c1dd6639c7285d4e3fc7ba846b84ea2df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-02-23  Robert Millan  <rmh@aybabtu.com>
+
+       * partmap/gpt.c (grub_gpt_magic): Add `0x' qualifier to each member,
+       since they were intended to be in hex.  This didn't break previously
+       because of a bug in gpt_partition_map_iterate() (see below).
+
+       (gpt_partition_map_iterate): Replace `grub_memcmp' with `! grub_memcmp'
+       when checking the validity of GPT header.
+       Remove `partno', since it always provides the same information as `i'.
+
 2008-02-21  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * include/grub/efi/time.h: Fix a wrong comment.
index 6bc87551d48799669080ac72b1bdd47e4808cd9d..36eaef21c736819d96c568b0a7cbf20e4921fe23 100644 (file)
@@ -27,7 +27,7 @@
 
 static grub_uint8_t grub_gpt_magic[8] =
   {
-    45, 46, 49, 20, 50, 41, 52, 54
+    0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54
   };
 
 static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY;
@@ -51,7 +51,6 @@ gpt_partition_map_iterate (grub_disk_t disk,
   struct grub_disk raw;
   struct grub_pc_partition_mbr mbr;
   grub_uint64_t entries;
-  int partno = 0;
   unsigned int i;
   int last_offset = 0;
 
@@ -75,7 +74,7 @@ gpt_partition_map_iterate (grub_disk_t disk,
   if (grub_disk_read (&raw, 1, 0, sizeof (gpt), (char *) &gpt))
     return grub_errno;
 
-  if (grub_memcmp (gpt.magic, grub_gpt_magic, sizeof (grub_gpt_magic)))
+  if (grub_memcmp (gpt.magic, grub_gpt_magic, sizeof (grub_gpt_magic)))
     return grub_error (GRUB_ERR_BAD_PART_TABLE, "no valid GPT header");
 
   grub_dprintf ("gpt", "Read a valid GPT header\n");
@@ -95,18 +94,17 @@ gpt_partition_map_iterate (grub_disk_t disk,
          part.len = (grub_le_to_cpu64 (entry.end)
                      - grub_le_to_cpu64 (entry.start) + 1);
          part.offset = entries;
-         part.index = partno;
+         part.index = i;
          part.partmap = &grub_gpt_partition_map;
          part.data = &entry;
 
          grub_dprintf ("gpt", "GPT entry %d: start=%lld, length=%lld\n",
-                       partno, part.start, part.len);
+                       i, part.start, part.len);
 
          if (hook (disk, &part))
            return grub_errno;
        }
 
-      partno++;
       last_offset += grub_le_to_cpu32 (gpt.partentry_size);
       if (last_offset == GRUB_DISK_SECTOR_SIZE)
        {