From: Charles Manning Date: Sat, 3 Dec 2016 05:43:00 +0000 (+1300) Subject: Fix yaffs_endian.h for Linux X-Git-Tag: aleph1-release~5 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=feb4ba97a4734822ed72ec1054d09b2bf1c65ed6 Fix yaffs_endian.h for Linux Yaffs loff_t is kept as loff_t and converted into Y_LOFF_T when when exported for Yaffs Direct. Signed-off-by: Charles Manning --- diff --git a/yaffs_endian.h b/yaffs_endian.h index d37bc50..d9b4e07 100644 --- a/yaffs_endian.h +++ b/yaffs_endian.h @@ -29,19 +29,20 @@ static inline u32 swap_u32(u32 val) #define swap_s32(val) \ (s32)(swap_u32((u32)(val))) -static inline Y_LOFF_T swap_loff_t(Y_LOFF_T lval) +static inline loff_t swap_loff_t(loff_t lval) { u32 vall = swap_u32((u32) (lval & 0xffffffff)); u32 valh; - if (sizeof(Y_LOFF_T) == sizeof(u32)) - return (Y_LOFF_T) vall; + if (sizeof(loff_t) == sizeof(u32)) + return (loff_t) vall; valh = swap_u32((u32) ((lval >> 32) & 0xffffffff)); - return (Y_LOFF_T)((((u64)vall) << 32) | valh); + return (loff_t)((((u64)vall) << 32) | valh); } +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); void yaffs_do_endian_oh(struct yaffs_dev *dev, struct yaffs_obj_hdr *oh);