Strange code in ide_cdrom_register

From: Peter Chubb (peter@chubb.wattle.id.au)
Date: Wed May 29 2002 - 21:02:21 EST


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/



This archive was generated by hypermail 2b29 : Fri May 31 2002 - 22:00:27 EST