From: Karel Zak Date: Mon, 6 Feb 2012 16:34:18 +0000 (+0100) Subject: libblkid: remove >> 9 from GPT code X-Git-Tag: v2.21-rc2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c78cef54ce3967abf54d151433e1c3d551e0fad3;p=thirdparty%2Futil-linux.git libblkid: remove >> 9 from GPT code Signed-off-by: Karel Zak --- diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c index a4838d84be..1a50494d59 100644 --- a/libblkid/src/partitions/gpt.c +++ b/libblkid/src/partitions/gpt.c @@ -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; }