public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Grant Grundler <grundler@parisc-linux.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Kyle McMartin <kyle@mcmartin.ca>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 14/20] parisc: use the new byteorder headers
Date: Fri, 01 Aug 2008 14:23:37 -0700	[thread overview]
Message-ID: <1217625817.5846.5.camel@brick> (raw)
In-Reply-To: <20080801160647.GA22049@colo.lackof.org>

On Fri, 2008-08-01 at 10:06 -0600, Grant Grundler wrote:
> On Thu, Jul 17, 2008 at 05:09:43PM -0700, Harvey Harrison wrote:
> > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> > ---
> >  include/asm-parisc/byteorder.h |   37 ++++++++++++-------------------------
> >  1 files changed, 12 insertions(+), 25 deletions(-)
> > 
> > diff --git a/include/asm-parisc/byteorder.h b/include/asm-parisc/byteorder.h
> > index db14831..5e56b1b 100644
> > --- a/include/asm-parisc/byteorder.h
> > +++ b/include/asm-parisc/byteorder.h
> > @@ -4,9 +4,10 @@
> >  #include <asm/types.h>
> >  #include <linux/compiler.h>
> >  
> > -#ifdef __GNUC__
> > +#define __LITTLE_ENDIAN
> 
> Sorry, this looks wrong. parisc is big endian.

Sorry, it is wrong.  It of course should be __BIG_ENDIAN

> > +#define __SWAB_64_THRU_32__
> 
> Should this only be defined if BITS_PER_LONG is <=32  ?
> 

The new byteorder headers only uses this if no __arch_swab64 is defined.

Further down in the parisc version, an __arch_swab64 is defined in the
BITS_PER_LONG >=32 case, making this moot.

>From the new linux/swab.h:

static inline __attribute_const__ __u64 ___swab64(__u64 val)
{
#ifdef __arch_swab64
	return __arch_swab64(val);
#elif defined(__arch_swab64p)
	return __arch_swab64p(&val);
#elif defined(__SWAB_64_THRU_32__)
	__u32 h = val >> 32;
	__u32 l = val & ((1ULL << 32) - 1);
	return (((__u64)___swab32(l)) << 32) | ((__u64)(___swab32(h)));
#else
	return __const_swab64(val);
#endif
}

Other than the endianness, any other concerns?

Harvey


  reply	other threads:[~2008-08-01 21:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18  0:09 [PATCH 14/20] parisc: use the new byteorder headers Harvey Harrison
2008-08-01 16:06 ` Grant Grundler
2008-08-01 21:23   ` Harvey Harrison [this message]
2008-08-01 23:18     ` Grant Grundler
2008-08-02  5:52       ` Harvey Harrison
2008-08-02 18:03       ` Harvey Harrison

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=1217625817.5846.5.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=grundler@parisc-linux.org \
    --cc=kyle@mcmartin.ca \
    --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