linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Benny Halevy <bhalevy@panasas.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH RFC 02/13] sunrpc: ntoh -> be*_to_cpu
Date: Sat, 12 Sep 2009 15:00:01 +0100	[thread overview]
Message-ID: <20090912140001.GD5858@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1250090508-9572-1-git-send-email-bhalevy@panasas.com>

On Wed, Aug 12, 2009 at 06:21:48PM +0300, Benny Halevy wrote:
> ntohl is already defined as be32_to_cpu.
> be64_to_cpu has architecture specific optimized implementations.

>  static inline __be32 *
>  xdr_decode_hyper(__be32 *p, __u64 *valp)
>  {
> -	*valp  = ((__u64) ntohl(*p++)) << 32;
> -	*valp |= ntohl(*p++);
> -	return p;
> +	*valp = be64_to_cpup((__be64 *)p);
> +	return p + 2;
>  }

Erm...  Who has promised you that p will be 64bit-aligned?

  reply	other threads:[~2009-09-12 15:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 15:15 [PATCH RFC 0/13] xdr macros cleanup Benny Halevy
2009-08-12 15:21 ` [PATCH RFC 01/13] sunrpc: hton -> cpu_to_be* Benny Halevy
2009-08-12 15:21 ` [PATCH RFC 02/13] sunrpc: ntoh -> be*_to_cpu Benny Halevy
2009-09-12 14:00   ` Al Viro [this message]
2009-09-13 16:14     ` Benny Halevy
2009-09-15 16:05     ` [PATCH] sunrpc: xdr_xcode_hyper helpers cannot presume 64-bit alignment Benny Halevy
2009-08-12 15:21 ` [PATCH RFC 03/13] sunrpc: introduce 32-bit Xcoding helpers Benny Halevy
2009-08-12 20:12   ` Trond Myklebust
2009-08-12 15:21 ` [PATCH RFC 04/13] nfs: nfs4xdr: get rid of WRITE32 Benny Halevy
2009-08-12 15:22 ` [PATCH RFC 05/13] nfs: nfs4xdr: get rid of WRITE64 Benny Halevy
2009-08-12 15:22 ` [PATCH RFC 06/13] nfs: nfs4xdr: get rid of WRITEMEM Benny Halevy
2009-08-12 15:22 ` [PATCH RFC 07/13] nfs: nfs4xdr: merge xdr_encode_int+xdr_encode_opaque_fixed into xdr_encode_opaque Benny Halevy
2009-08-12 15:22 ` [PATCH RFC 08/13] nfs: nfs4xdr: change RESERVE_SPACE macro into a static helper Benny Halevy
2009-08-12 15:22 ` [PATCH RFC 09/13] nfs: nfs4xdr: get rid of READ32 Benny Halevy
2009-08-12 15:22 ` [PATCH RFC 10/13] nfs: nfs4xdr: get rid of READ64 Benny Halevy
2009-08-12 15:22 ` [PATCH RFC 11/13] nfs: nfs4xdr: get rid of READTIME macro Benny Halevy
2009-08-12 15:22 ` [PATCH RFC 12/13] nfs: nfs4xdr: change COPYMEM macro into a static function Benny Halevy
2009-08-12 20:36   ` Trond Myklebust
2009-08-12 15:22 ` [PATCH RFC 13/13] nfs: nfs4xdr: get rid of READ_BUF Benny Halevy
2009-08-12 21:05   ` Trond Myklebust

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=20090912140001.GD5858@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bhalevy@panasas.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).