Commit 901fbc3b authored by Doug Ledford's avatar Doug Ledford

aic7xxx_old: update biosparam function with the (ugly) detail that

	cylinder values > 65535 get truncated
parent ba26d89f
......@@ -10998,15 +10998,11 @@ aic7xxx_biosparam(struct scsi_device *sdev, struct block_device *bdev,
{
heads = 255;
sectors = 63;
/* pull this crap because 64bit math in the kernel is a no-no as far
* as division is concerned, but 64bit multiplication can be done */
/* This shift approximates capacity / (heads * sectors) */
cylinders = capacity >> 14;
/* Now we brute force upping cylinders until we go over by 1 */
while( capacity >= (cylinders * sectors * heads))
cylinders++;
/* Then back it back down by one */
cylinders--;
if(capacity > (65535 * heads * sectors))
cylinders = 65535;
else
cylinders = ((unsigned int)capacity) / (heads * sectors);
}
geom[0] = (int)heads;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment