linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <benny@tonian.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 10/10] efi: fix compiler warnings
Date: Mon,  5 Dec 2011 10:14:35 +0200	[thread overview]
Message-ID: <1323072875-18579-1-git-send-email-benny@tonian.com> (raw)
In-Reply-To: <4EDC7C4E.1040901@tonian.com>

From: Benny Halevy <bhalevy@tonian.com>

Signed-off-by: Benny Halevy <bhalevy@tonian.com>
---
 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


      parent reply	other threads:[~2011-12-05  8:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05  8:09 [PATCH 0/10] pnfs-block ctl Benny Halevy
2011-12-05  8:12 ` [PATCH 01/10] use gcc Benny Halevy
2011-12-05  8:13 ` [PATCH 02/10] efi: fix user-land debug printouts Benny Halevy
2011-12-05  8:13 ` [PATCH 03/10] ctl: improve " Benny Halevy
2011-12-05  8:13 ` [PATCH 04/10] increase compiler warning level Benny Halevy
2011-12-05  8:13 ` [PATCH 05/10] ctl: always return a value from find_dm_name Benny Halevy
2011-12-05  8:13 ` [PATCH 06/10] add missing includes Benny Halevy
2011-12-05  8:14 ` [PATCH 07/10] ctl: fix compiler warnings Benny Halevy
2011-12-05  8:14 ` [PATCH 08/10] fix compiler warnings around get_output use of argv Benny Halevy
2011-12-05  8:14 ` [PATCH 09/10] ctl: main should return 0 on success Benny Halevy
2011-12-05  8:14 ` Benny Halevy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323072875-18579-1-git-send-email-benny@tonian.com \
    --to=benny@tonian.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).