Strange code in ide_cdrom_register

Peter Chubb (peter@chubb.wattle.id.au)
Thu, 30 May 2002 12:02:21 +1000


Hi,
This code snippet in ide_cdrom_register() seems really
strange...

devinfo->ops = &ide_cdrom_dops;
devinfo->mask = 0;
>>> *(int *)&devinfo->speed = CDROM_STATE_FLAGS (drive)->current_speed;
>>> *(int *)&devinfo->capacity = nslots;
devinfo->handle = (void *) drive;
strcpy(devinfo->name, drive->name);

devinfo->speed and devinfo->capacity are both ints. So the casts are
just a disaster waiting to happen, if the types of capacity or speed
ever change?

Peter C

--
You are lost in a maze of bitkeeper repositories, all slightly different.
-
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/