Re: ide-probe.c logic wrong?

Edmund GRIMLEY EVANS (edmundo@rano.demon.co.uk)
Fri, 22 Jan 1999 17:17:48 +0000


> No, the current kernel code is correct.

Thanks for your detailed description, which justifies what the code
does to the kernel's variables.

However, I still see no justification for the circumstances in which
the warning message "cdrom or floppy?, assuming " is displayed ...

If type is being set to ide_cdrom, why should the presence of the
substring "oppy" in id->model cause the warning to be suppressed? This
seems counter-intuitive ... unless the presence of "oppy" in id->model
has already been tested for elsewhere and used to adjust drive->media?

Your explanation suggests that the code should read:

case ide_floppy:
if (!strstr(id->model, "CD-ROM") && drive->media != ide_cdrom)
{
if (!strstr(id->model, "oppy") &&
!strstr(id->model, "poyp") &&
!strstr(id->model, "ZIP"))
printk("cdrom or floppy?, assuming ");
printk ("FLOPPY");
break;
}
type = ide_cdrom; /* Early cdrom models used zero */
case ide_cdrom:

The original was:

case ide_floppy:
if (!strstr(id->model, "CD-ROM")) {
if (!strstr(id->model, "oppy") && !strstr(id->model,
"poyp") && !strstr(id->model, "ZIP"))
printk("cdrom or floppy?, assuming ");
if (drive->media != ide_cdrom) {
printk ("FLOPPY");
break;
}
}
type = ide_cdrom; /* Early cdrom models used zero */
case ide_cdrom:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/