lkml.org 
[lkml]   [2000]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix big endian ext2 bmap in 2.2.


On Wed, 20 Sep 2000, Andi Kleen wrote:

>
> This patch fixes an obvious bug introduced with the ext2 changes in 2.2.18pre
> (look up the definition of le32_to_cpu on BE machines without a special
> assembler version for it and on machines that have it)
>
> Patch against 2.2.18pre9

Wrong fix. swab32() is the guilty party here - it should be

static inline __u32 swab32(__u32 x)
{
return
((x & (__u32)0x000000ffUL) << 24) |
((x & (__u32)0x0000ff00UL) << 8) |
((x & (__u32)0x00ff0000UL) >> 8) |
((x & (__u32)0xff000000UL) >> 24) );
}

Ditto for other stuff in linux/byteorder/swab.h

My fault - I didn't realize that the bloody thing was a macro (it
obviously shouldn't be, exactly due to problems with side effects).

Alan, what do you prefer? I think that fixing the macros in swab.h is the
Right Thing(tm).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.151 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site