yaffsfs.c: Fix NULL dereference in yaffs_unmount2_reldev()
[yaffs2.git] / yaffs_guts.c
index c09c88f15df198fc1ae6b606e324eb81138f2ed3..b83fa6388a22f7861cc00d89001678d927568584 100644 (file)
@@ -163,6 +163,8 @@ u8 *yaffs_get_temp_buffer(struct yaffs_dev * dev)
 
 }
 
+/* Frees all the temp_buffer objects in the yaffs_dev instance
+*/
 void yaffs_release_temp_buffer(struct yaffs_dev *dev, u8 *buffer)
 {
        int i;
@@ -4900,10 +4902,15 @@ static void yaffs_oh_time_load(u32 *yst_time, u32 *win_time, YTIME_T timeval)
        u32 lower;
 
        lower = timeval & 0xffffffff;
-       if (sizeof(YTIME_T) > sizeof(u32))
-               upper = (timeval >> 32) & 0xffffffff;
-       else
-               upper = 0;
+       /* we have to use #defines here insted of an if statement
+       otherwise the compiler throws an error saying that
+       right shift count >= width of type when we are using 32 bit time.
+       */
+       #ifdef CONFIG_YAFFS_USE_32_BIT_TIME_T
+                upper = 0;
+        #else
+                upper = (timeval >> 32) & 0xffffffff;
+        #endif
 
        *yst_time = lower;
        win_time[0] = lower;