Bad comment in drivers/block/rd.c?

Christian Hardmeier (chrigi@infinite.loop.org)
Tue, 19 Nov 1996 17:29:34 +0100 (MET)


drivers/block/rd.c (from the 2.0.25 source tree) says:

[...]
> #ifdef RD_LOADER
> /*
> * This routine tries to a ramdisk image to load, and returns the
> * number of blocks to read for a non-compressed image, 0 if the image
^^^^^^^^^^^^^^
> * is a compressed image, and -1 if an image with the right magic
^^^^^^^^^^^^^^^^^^^^^
> * numbers could not be found.
> *
> * We currently check for the following magic numbers:
> * minix
> * ext2
> * gzip
> */
> int
> identify_ramdisk_image(kdev_t device, struct file *fp, int start_block)
> {
[...]
> /*
> * Read block 0 to test for gzipped kernel
> */
[...]
> /*
> * If it matches the gzip magic numbers, return -1
^^^^^^^^^
> */
> if (buf[0] == 037 && ((buf[1] == 0213) || (buf[1] == 0236))) {
> printk(KERN_NOTICE
> "RAMDISK: Compressed image found at block %d\n",
> start_block);
> nblocks = 0;
^^^^^^^^^^^^
> goto done;
> }
[...]
> return nblocks;
^^^^^^^
> }
[...]

Shouldn't the comment say "if it matches the gzip magic numbers, return 0"
rather than "return -1"?

BTW, if I want to make a bootable floppy that contains a compressed initrd
image, how do I have to do this? Is it possible at all? I think initrd.txt
says it is, but it only describes how to put an uncompressed image to the
disk. (I want to use /dev/ram as root device)

TIA,
Christian