public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Kyle McMartin <kyle@mcmartin.ca>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kyle McMartin <kyle@mcmartin.ca>
Subject: Re: [COMPAT] Add compat_merge64 helper
Date: Sat, 29 Sep 2007 01:38:23 +0200	[thread overview]
Message-ID: <200709290138.24562.arnd@arndb.de> (raw)
In-Reply-To: <1191018832-18069-1-git-send-email-kyle@mcmartin.ca>

On Saturday 29 September 2007, you wrote:
> +static inline u64 compat_merge64(u32 left, u32 right)
> +{
> +#if defined(__BIG_ENDIAN)
> +       return ((u64)left << 32) | right;
> +#else /* defined (__LITTLE_ENDIAN) */
> +       return ((u64)right << 32) | left;
> +#endif
> +}

Looks good, if we can guarantee that

1. Byte order matches the order in which 64 bit arguments are split
   in system call conventions on all platforms.
2. Every user of compat_merge64() includes asm/byteorder.h

Both should be easy to prove, but I'm not convinced until someone
actually does it.

	Arnd <><

  parent reply	other threads:[~2007-09-28 23:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28 22:33 [COMPAT] Add compat_merge64 helper Kyle McMartin
2007-09-28 22:33 ` [PATCH] Generic compat_sys_fallocate Kyle McMartin
2007-09-29  9:11   ` Geert Uytterhoeven
2007-09-28 23:38 ` Arnd Bergmann [this message]
2007-09-29  0:01   ` [COMPAT] Add compat_merge64 helper Kyle McMartin
2007-09-28 23:52     ` Arnd Bergmann
2007-09-29  0:02     ` Kyle McMartin
2007-09-29  7:23       ` Paul Mundt
2007-09-29  9:48 ` Heiko Carstens
2007-10-03 12:12   ` Ralf Baechle

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=200709290138.24562.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=kyle@mcmartin.ca \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@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