From f132219548fc452a9fcd6f80af89abce4294f0ea Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 8 May 2013 12:21:23 -0400 Subject: ftl_check/ftl_format/nftldump: use existing mtd_swab.h header We already have a helper header for swapping bytes as needed, so cut the ftl tools over to that rather than re-implement things. I don't actually have any devices with this kind of flash, so I can't runtime test it. But things *look* ok to me :). Signed-off-by: Mike Frysinger --- nftldump.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'nftldump.c') diff --git a/nftldump.c b/nftldump.c index 90ea072..32f4f2f 100644 --- a/nftldump.c +++ b/nftldump.c @@ -50,13 +50,8 @@ static int NumMedHeads; static unsigned char BadUnitTable[MAX_ERASE_ZONES]; -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define SWAP16(x) do { ; } while(0) -#define SWAP32(x) do { ; } while(0) -#else -#define SWAP16(x) do { x = swab16(x); } while(0) -#define SWAP32(x) do { x = swab32(x); } while(0) -#endif +#define SWAP16(x) do { x = le16_to_cpu(x); } while(0) +#define SWAP32(x) do { x = le32_to_cpu(x); } while(0) /* VUCtable, store the Erase Unit Number of the first Erase Unit in the chain */ static unsigned short *VUCtable; -- cgit v1.2.3