Re: IDE fix... ("obviously correct").

Guest section DW (dwguest@win.tue.nl)
Mon, 17 May 1999 21:30:30 +0200 (MET DST)


From: R.E.Wolff@BitWizard.nl (Rogier Wolff)

diff -ur linux-2.2.9.clean/drivers/block/ide-disk.c linux/drivers/block/ide-disk.c
--- linux-2.2.9.clean/drivers/block/ide-disk.c Wed Apr 7 17:03:50 1999
+++ linux/drivers/block/ide-disk.c Mon May 17 07:53:48 1999
@@ -106,7 +106,8 @@
return 1; /* lba_capacity is good */
}
/* some drives have the word order reversed */
- lba_sects = (lba_sects << 16) | (lba_sects >> 16);
+ lba_sects = ((lba_sects & 0xffff) << 16) |
+ ((lba_sects >> 16) & 0xffff);
if ((lba_sects - chs_sects) < _10_percent) {
id->lba_capacity = lba_sects; /* fix it */
return 1; /* lba_capacity is (now) good */

Yes. It looks like the second `& 0xffff' is superfluous.

> It looks as if noone with a 64 bit machine has gotten bitten by this yet

This is something that only applies to old broken disks,
and is only used to prefer LBA capacity over BIOS capacity
if possible. I do not know whether there are any old broken
disks in use on an Alpha that require this (e.g., because
they are larger than 8.4 GB). Maybe none exist.

Waiting to be contradicted... - Andries

-
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/