[PATCH] do_mounts.c - compiler warning, comments, cramfs

From: kuebelr@email.uc.edu
Date: Sat Jun 08 2002 - 14:56:10 EST


This patch tweaks a few things in do_mounts.c:

-change_floppy() is defined but not used if neither CONFIG_BLK_DEV_RAM
        or CONFIG_BLK_DEV_FD are defined
-since the gzip code is already in the kernel, why not do away w/ the
        BUILD_CRAMDISK stuff and always support compressed images
-one incorrect comment changed
-one repeated NOTE removed

If no one yells at me for this, I will submit it to the patch monkey.

Rob.

--- linux-clean/init/do_mounts.c Fri Jun 7 23:42:15 2002
+++ linux-dirty/init/do_mounts.c Sat Jun 8 15:38:52 2002
@@ -16,8 +16,6 @@
 #include <linux/ext2_fs.h>
 #include <linux/romfs_fs.h>
 
-#define BUILD_CRAMDISK
-
 extern int get_filesystem_list(char * buf);
 
 asmlinkage long sys_mount(char *dev_name, char *dir_name, char *type,
@@ -378,6 +376,7 @@
         return sys_symlink(path + n + 5, name);
 }
 
+#if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_RAM)
 static void __init change_floppy(char *fmt, ...)
 {
         struct termios termios;
@@ -405,6 +404,7 @@
                 close(fd);
         }
 }
+#endif /* CONFIG_BLK_DEV_FD || CONFIG_BLK_DEV_RAM */
 
 #ifdef CONFIG_BLK_DEV_RAM
 
@@ -466,7 +466,7 @@
         read(fd, buf, size);
 
         /*
- * If it matches the gzip magic numbers, return -1
+ * If it matches the gzip magic numbers, return 0
          */
         if (buf[0] == 037 && ((buf[1] == 0213) || (buf[1] == 0236))) {
                 printk(KERN_NOTICE
@@ -548,19 +548,13 @@
                 goto done;
 
         if (nblocks == 0) {
-#ifdef BUILD_CRAMDISK
                 if (crd_load(in_fd, out_fd) == 0)
                         goto successful_load;
-#else
- printk(KERN_NOTICE
- "RAMDISK: Kernel does not support compressed "
- "RAM disk images\n");
-#endif
                 goto done;
         }
 
         /*
- * NOTE NOTE: nblocks suppose that the blocksize is BLOCK_SIZE, so
+ * NOTE: nblocks suppose that the blocksize is BLOCK_SIZE, so
          * rd_load_image will work only with filesystem BLOCK_SIZE wide!
          * So make sure to use 1k blocksize while generating ext2fs
          * ramdisk-images.
@@ -860,7 +854,7 @@
         mount_devfs_fs ();
 }
 
-#ifdef BUILD_CRAMDISK
+#ifdef CONFIG_BLK_DEV_RAM
 
 /*
  * gzip declarations
@@ -1005,4 +999,4 @@
         return result;
 }
 
-#endif /* BUILD_CRAMDISK */
+#endif /* CONFIG_BLK_DEV_RAM */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 15 2002 - 22:00:13 EST