From: Luca Berra <bluca@comedia.it>
To: "Neil Brown (neilb@suse.de)" <neilb@suse.de>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>
Subject: [mdadm PATCH 1/3] fix gcc warnings about strict-aliasing rules
Date: Sat, 27 Feb 2010 14:53:38 +0100 [thread overview]
Message-ID: <20100227135338.GB24207@maude.comedia.it> (raw)
In-Reply-To: <cover.1267264723.git.bluca@comedia.it>
Signed-off-by: Luca Berra <bluca@comedia.it>
---
util.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/util.c b/util.c
index 68f048d..1def2a0 100644
--- a/util.c
+++ b/util.c
@@ -1160,7 +1160,7 @@ static int get_gpt_last_partition_end(int fd, unsigned long long *endofpart)
entry_size = __le32_to_cpu(buf[GPT_ENTRY_SIZE_OFFSET]);
/* Check GPT signature*/
- if (*((__u64*)buf) != GPT_SIGNATURE_MAGIC)
+ if ((__u64)buf[0] != GPT_SIGNATURE_MAGIC)
return -1;
/* sanity checks */
@@ -1178,7 +1178,7 @@ static int get_gpt_last_partition_end(int fd, unsigned long long *endofpart)
/* is this valid partition? */
if (memcmp(part->type_guid, empty_gpt_entry, 16) != 0) {
/* check the last lba for the current partition */
- curr_part_end = __le64_to_cpu(*(__u64*)part->ending_lba);
+ curr_part_end = __le64_to_cpu((__u64)part->ending_lba[0]);
if (curr_part_end > *endofpart)
*endofpart = curr_part_end;
}
--
1.7.0
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
next prev parent reply other threads:[~2010-02-27 13:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-27 10:14 [mdadm PATCH 0/3] *** fix gcc warnings *** Luca Berra
2010-02-27 13:53 ` [mdadm PATCH 2/3] fix compiler warnings Luca Berra
2010-02-27 13:53 ` Luca Berra [this message]
2010-03-02 7:40 ` [mdadm PATCH 1/3] fix gcc warnings about strict-aliasing rules Michael Tokarev
2010-03-02 7:48 ` Luca Berra
2010-03-03 4:19 ` Neil Brown
2010-02-27 13:53 ` [mdadm PATCH 3/3] workaround unused results Luca Berra
2010-03-02 23:59 ` [mdadm PATCH 0/3] *** fix gcc warnings *** Neil Brown
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=20100227135338.GB24207@maude.comedia.it \
--to=bluca@comedia.it \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.