summaryrefslogtreecommitdiff
path: root/nftldump.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-05-08 12:21:23 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-07-01 08:48:09 +0300
commitf132219548fc452a9fcd6f80af89abce4294f0ea (patch)
tree636588746b28781876a95043e34947c764c41478 /nftldump.c
parentf1825095f5fe9173828262d64ba8c1588778ffc6 (diff)
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 <vapier@gentoo.org>
Diffstat (limited to 'nftldump.c')
-rw-r--r--nftldump.c9
1 files changed, 2 insertions, 7 deletions
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;