]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: remove >> 9 from GPT code
authorKarel Zak <kzak@redhat.com>
Mon, 6 Feb 2012 16:34:18 +0000 (17:34 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 6 Feb 2012 16:35:39 +0000 (17:35 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/gpt.c

index a4838d84be999070048cdf337e9630b7ad07d636..1a50494d59d9aa4f50478e88da49c74b895e68db 100644 (file)
@@ -133,10 +133,12 @@ static void swap_efi_guid(efi_guid_t *uid)
 static int last_lba(blkid_probe pr, uint64_t *lba)
 {
        blkid_loff_t sz = blkid_probe_get_size(pr);
-       if (sz < blkid_probe_get_sectorsize(pr))
+       unsigned int ssz = blkid_probe_get_sectorsize(pr);
+
+       if (sz < ssz)
                return -1;
 
-       *lba = (sz >> 9) - 1;
+       *lba = (sz / ssz) - 1ULL;
        return 0;
 }