switch (type) {
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:
Suppose drive->media is equal to ide_cdrom.
Suppose id->model contains none of the substrings mentioned.
Then the code prints "... assuming " and sets the type to ide_cdrom.
Now suppose id->model contains "oppy" but none of the other substrings.
Then the code DOESN'T print "... assuming ", but it STILL sets the type
to ide_cdrom.
This doesn't make sense!
Here is what I suspect was intended:
switch (type) {
case ide_floppy:
if (strstr(id->model, "CD-ROM")) goto cdrom;
if (!strstr(id->model, "oppy") && !strstr(id->model,
"poyp") && !strstr(id->model, "ZIP")) {
printk("cdrom or floppy?, assuming ");
if (drive->media == ide_cdrom) goto cdrom;
}
printk ("FLOPPY");
break;
cdrom:
type = ide_cdrom; /* Early cdrom models used zero
*/
case ide_cdrom:
Edmund
-
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/