public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Strange code in ide_cdrom_register
@ 2002-05-30  2:02 Peter Chubb
  2002-05-30  7:26 ` Michael Dunsky
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Chubb @ 2002-05-30  2:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: axboe


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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-05-30 20:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-30  2:02 Strange code in ide_cdrom_register Peter Chubb
2002-05-30  7:26 ` Michael Dunsky
2002-05-30  9:05   ` Peter Chubb
2002-05-30 10:35     ` J.A. Magallon
2002-05-30 20:19     ` Michael Dunsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox