lkml.org 
[lkml]   [2010]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [RFC] #define __BYTE_ORDER
On Wed, 24 Mar 2010 19:37:36 +0100
Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> On Wed, Mar 24, 2010 at 19:21, Andrew Morton <akpm@linux-foundation.org> wrote:
> > On Wed, 17 Mar 2010 19:10:55 +0100
> > Joakim Tjernlund <Joakim.Tjernlund@transmode.se> wrote:
> >
> >> Linux does not define __BYTE_ORDER in its endian header files
> >> which makes some header files bend backwards to get at the
> >> current endian. Lets #define __BYTE_ORDER in big_endian.h/litte_endian.h
> >> to make it easier for header files that are used in user space too.
> >
> > I don't get it. __Why not nuke __BYTE_ORDER altogether and do `#ifdef
> > __LITTLE_ENDIAN' and `#ifdef __BIG_ENDIAN' everywhere?
>
> Because in userspace the convention is that
> 1. _both_ __LITTLE_ENDIAN and __BIG_ENDIAN are defined,
> 2. you have to test for e.g. __BYTE_ORDER == __BIG_ENDIAN.

umph. We don't _have_ to copy userspace, and removing __BYTE_ORDER
altogether makes the kernel cleaner and simpler.

But if we did that, we shouldn't have used the same symbols as
userspace. Sigh.



\
 
 \ /
  Last update: 2010-03-24 19:53    [W:0.053 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site