summaryrefslogtreecommitdiff
path: root/nftl_format.c
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@gmail.com>2006-05-16 05:39:27 -0500
committerJosh Boyer <jwboyer@gmail.com>2006-05-16 05:39:27 -0500
commit7349dc6de42b696619d7632fb6a016f848d63bca (patch)
treed98e517e7e1c5ec3906d642c4bedf7c3fdebd364 /nftl_format.c
parentba3d8f61a6ce84437bc8e92d30b541336fb6b47b (diff)
Consolidate the swab macros into one location
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Diffstat (limited to 'nftl_format.c')
-rw-r--r--nftl_format.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/nftl_format.c b/nftl_format.c
index a04411a..b0a80cf 100644
--- a/nftl_format.c
+++ b/nftl_format.c
@@ -39,27 +39,7 @@
#include <mtd/mtd-user.h>
#include <mtd/nftl-user.h>
#include <mtd/inftl-user.h>
-
-#define swab16(x) \
- ((__u16)( \
- (((__u16)(x) & (__u16)0x00ffU) << 8) | \
- (((__u16)(x) & (__u16)0xff00U) >> 8) ))
-#define swab32(x) \
- ((__u32)( \
- (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
- (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
- (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
- (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define cpu_to_le16(x) ({ __u16 _x = x; swab16(_x); })
-#define cpu_to_le32(x) ({ __u32 _x = x; swab32(_x); })
-#else
-#define cpu_to_le16(x) (x)
-#define cpu_to_le32(x) (x)
-#endif
-#define le32_to_cpu(x) cpu_to_le32(x)
-#define le16_to_cpu(x) cpu_to_le16(x)
+#include <mtd_swab.h>
unsigned char BadUnitTable[MAX_ERASE_ZONES];
unsigned char *readbuf;