mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Bug in cpu_to_le32
@ 2004-11-01  2:23 Matthew Wilcox
  0 siblings, 0 replies; only message in thread
From: Matthew Wilcox @ 2004-11-01  2:23 UTC (permalink / raw)
  To: linux-kernel, fare; +Cc: Grant Grundler


Grant Grundler spotted we weren't using the optimised byteswap routines
on PA-RISC.  Here's why:

include/linux/byteorder/generic.h:90:#define le32_to_cpu __le32_to_cpu
include/linux/byteorder/big_endian.h:33:#define __le32_to_cpu(x) ___swab32((__force __u32)(__le32)(x))
and byteorder/swab.h:
#define ___swab32(x) \
({ \
        __u32 __x = (x); \
        ((__u32)( \
                (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
                (((__u32)(__x) & (__u32)0x0000ff00UL) <<  8) | \
                (((__u32)(__x) & (__u32)0x00ff0000UL) >>  8) | \
                (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
})

So le32_to_cpu() doesn't use optimised assembler on any platform.  And for
all you using ext3 on i386 ...

include/linux/byteorder/generic.h:95:#define cpu_to_be32 __cpu_to_be32
include/linux/byteorder/little_endian.h:38:#define __cpu_to_be32(x) ((__force __be32)___swab32((x)))

So it's not being used there either.  What is ___swabN() for anyway?  It seems
to be a duplicate of ___constant_swabN().

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-01  2:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-01  2:23 Bug in cpu_to_le32 Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome