Skip to content

Commit

Permalink
identify_ramdisk_image(): correct typo about return value in comment
Browse files Browse the repository at this point in the history
identify_ramdisk_image() returns 0 (not -1) if a gzipped ramdisk is found:

	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;
	}

	...

done:
	sys_lseek(fd, start_block * BLOCK_SIZE, 0);
	kfree(buf);
	return nblocks;
	^^^^^^^^^^^^^^

Hence correct the typo in the comment, which has existed since the
addition of compressed ramdisk support in 1.3.48.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Geert Uytterhoeven authored and torvalds committed Oct 16, 2008
1 parent 2e0eb73 commit 93fd85d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion init/do_mounts_rd.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ identify_ramdisk_image(int fd, int start_block)
sys_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
Expand Down

0 comments on commit 93fd85d

Please sign in to comment.