/*
* YAFFS: Yet another Flash File System . A NAND-flash specific file system.
*
- * Copyright (C) 2002-2011 Aleph One Ltd.
- * for Toby Churchill Ltd and Brightstar Engineering
+ * Copyright (C) 2002-2018 Aleph One Ltd.
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
static inline loff_t swap_loff_t(loff_t lval)
{
- u32 vall = swap_u32((u32) (lval & 0xffffffff));
+ u32 vall = swap_u32(FSIZE_LOW(lval));
u32 valh;
if (sizeof(loff_t) == sizeof(u32))
return (loff_t) vall;
- valh = swap_u32((u32) ((lval >> 32) & 0xffffffff));
+ valh = swap_u32(FSIZE_HIGH(lval));
- return (loff_t)((((u64)vall) << 32) | valh);
+ return FSIZE_COMBINE(vall, valh); /*NB: h and l are swapped. */
}
+
+
struct yaffs_dev;
void yaffs_do_endian_s32(struct yaffs_dev *dev, s32 *val);
void yaffs_do_endian_u32(struct yaffs_dev *dev, u32 *val);