netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-netdev <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH] kernel: add byteorder macros with alignment fixups
Date: Mon, 24 Mar 2008 09:35:43 -0700	[thread overview]
Message-ID: <1206376543.9265.5.camel@brick> (raw)
In-Reply-To: <20080323135939.GC4580@ucw.cz>

On Sun, 2008-03-23 at 14:59 +0100, Pavel Machek wrote:
> On Thu 2008-03-20 12:22:33, Harvey Harrison wrote:
> > +#ifdef __KERNEL__
> > +
> > +static inline u64 le64_to_cpu_unaligned(void *p)
> > +{
> > +	return __le64_to_cpu(get_unaligned((__le64 *)p));
> > +}
> 
> Why the cast? Should le64_to_cpu() take __le64 * parameter, so that normal
> typechecking still works?
> 							Pavel

Well, most places that would use this have a char *, or a u8 * so I was
avoiding a cast in most callers.

HPA made a good suggestion about this being in asm-generic allowing
arches to optimize this, so I'm reworking with that approach.

Harvey


  reply	other threads:[~2008-03-24 16:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-20 17:34 [RFC PATCH] kernel: add byteorder macros with alignment fixups Harvey Harrison
2008-03-20 18:29 ` Al Viro
2008-03-20 18:37   ` Harvey Harrison
2008-03-20 19:09     ` Al Viro
2008-03-20 19:22       ` Harvey Harrison
2008-03-23 13:59         ` Pavel Machek
2008-03-24 16:35           ` Harvey Harrison [this message]
2008-03-20 19:41       ` [PATCH] kernel: add byteorder function " Harvey Harrison
2008-03-20 20:16       ` [PATCH] kernel: create linux/unaligned.h Harvey Harrison
2008-03-20 20:39         ` Randy Dunlap
2008-03-20 20:08 ` [RFC PATCH] kernel: add byteorder macros with alignment fixups H. Peter Anvin

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=1206376543.9265.5.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=viro@ZenIV.linux.org.uk \
    /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).