From: Benny Halevy <bhalevy@xxxxxxxxxx> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxx> --- efi.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-) diff --git a/efi.c b/efi.c index 67b6211..a8c70d2 100644 --- a/efi.c +++ b/efi.c @@ -123,8 +123,6 @@ static size_t read_lba(int fd, u64 lba, u8 * buffer, size_t count) { - size_t totalreadcount = 0; - lseek(fd, lba * 512LL, 0); return read(fd, buffer, count); } @@ -205,9 +203,6 @@ static int is_gpt_valid(int fd, u64 lba, gpt_header **gpt, gpt_entry **ptes) { - u32 crc, origcrc; - u64 lastlba; - if (!(*gpt = alloc_read_gpt_header(fd, lba))) return 0; @@ -236,9 +231,6 @@ is_gpt_valid(int fd, u64 lba, /* We're done, all's well */ return 1; - fail_ptes: - free(*ptes); - *ptes = NULL; fail: free(*gpt); *gpt = NULL; @@ -284,7 +276,7 @@ efi_signature(int fd, struct partition_sig *sig) gpt_entry *ptes = NULL; int rval = 0; - sig->ps_sector_off = (u32)&((gpt_header *)0)->disk_guid.b[0]; + sig->ps_sector_off = __builtin_offsetof(gpt_header, disk_guid.b); sig->ps_sector = GPT_PRIMARY_PARTITION_TABLE_LBA; sig->ps_len = sizeof (efi_guid_t); -- 1.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html