lkml.org 
[lkml]   [2002]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectStrange code in ide_cdrom_register

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/

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.062 / U:1.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site