mn10300: convert to use __HEAD and HEAD_TEXT macros.
[pandora-kernel.git] / init / initramfs.c
index 80cd713..9ee7b78 100644 (file)
@@ -310,7 +310,8 @@ static int __init do_name(void)
                        if (wfd >= 0) {
                                sys_fchown(wfd, uid, gid);
                                sys_fchmod(wfd, mode);
-                               sys_ftruncate(wfd, body_len);
+                               if (body_len)
+                                       sys_ftruncate(wfd, body_len);
                                vcollected = kstrdup(collected, GFP_KERNEL);
                                state = CopyFile;
                        }
@@ -515,6 +516,7 @@ skip:
        initrd_end = 0;
 }
 
+#ifdef CONFIG_BLK_DEV_RAM
 #define BUF_SIZE 1024
 static void __init clean_rootfs(void)
 {
@@ -561,6 +563,7 @@ static void __init clean_rootfs(void)
        sys_close(fd);
        kfree(buf);
 }
+#endif
 
 static int __init populate_rootfs(void)
 {