From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfsprogs: fix harmless sparse endian nit
Date: Mon, 27 Oct 2014 07:26:03 -0400 [thread overview]
Message-ID: <20141027112603.GB39598@bfoster.bfoster> (raw)
In-Reply-To: <544992F1.8050803@redhat.com>
On Thu, Oct 23, 2014 at 06:44:49PM -0500, Eric Sandeen wrote:
> h_crc is __le32 but cpu_to_be32() is... __be32. So sparse
> complains, even though it's harmless.
>
> Although sparse is smart about bare 0s, and we could
> drop the swap, other places explicitly swap to keep
> things clear (I guess?) so "swap" the 0 with the proper
> routine.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
Looks good. I agree that the swap helps with clarity.
Reviewed-by: Brian Foster <bfoster@redhat.com>
>
> diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
> index 9ee89d3..dd8baa6 100644
> --- a/libxfs/rdwr.c
> +++ b/libxfs/rdwr.c
> @@ -187,7 +187,7 @@ libxfs_log_header(
> head->h_len = cpu_to_be32(sunit - BBSIZE);
> else
> head->h_len = cpu_to_be32(20);
> - head->h_crc = cpu_to_be32(0);
> + head->h_crc = cpu_to_le32(0);
> head->h_prev_block = cpu_to_be32(-1);
> head->h_num_logops = cpu_to_be32(1);
> head->h_cycle_data[0] = cpu_to_be32(0xb0c0d0d0);
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2014-10-27 11:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-23 23:44 [PATCH] xfsprogs: fix harmless sparse endian nit Eric Sandeen
2014-10-27 11:26 ` Brian Foster [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=20141027112603.GB39598@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=sandeen@redhat.com \
--cc=xfs@oss.sgi.com \
/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