Added endianness support for YTIME_T
[yaffs2.git] / yaffs_endian.c
index 0bc67fef41f8b5a906ccf7a681fa58a2f27911da..571a35f7642739041b888f94bf2102451831c8d8 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * 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>
  *
@@ -37,15 +36,15 @@ void yaffs_do_endian_oh(struct yaffs_dev *dev, struct yaffs_obj_hdr *oh)
                return;
        /* Change every field */
        oh->type = swap_u32(oh->type);
-       oh->parent_obj_id = swap_s32(oh->parent_obj_id);
+       oh->parent_obj_id = swap_u32(oh->parent_obj_id);
 
        oh->yst_mode = swap_u32(oh->yst_mode);
 
        oh->yst_uid = swap_u32(oh->yst_uid);
        oh->yst_gid = swap_u32(oh->yst_gid);
-       oh->yst_atime = swap_u32(oh->yst_atime);
-       oh->yst_mtime = swap_u32(oh->yst_mtime);
-       oh->yst_ctime = swap_u32(oh->yst_ctime);
+       oh->yst_atime = swap_ytime_t(oh->yst_atime);
+       oh->yst_mtime = swap_ytime_t(oh->yst_mtime);
+       oh->yst_ctime = swap_ytime_t(oh->yst_ctime);
 
        oh->file_size_low = swap_u32(oh->file_size_low);