X-Git-Url: http://aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_endian.h;h=e2fc602edf9c4da545e651f053d66963175a80ec;hp=d9b4e07d21f334eef70d412f5fe75209a0a757f6;hb=c1422c27f5f17c68acf261209292c7489085df6b;hpb=b6a3ae56bbcd59fdc1769f69f445a5e43f8297bc diff --git a/yaffs_endian.h b/yaffs_endian.h index d9b4e07..e2fc602 100644 --- a/yaffs_endian.h +++ b/yaffs_endian.h @@ -31,17 +31,19 @@ static inline u32 swap_u32(u32 val) 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);