Commit 20333d17 authored by Matt Domsch's avatar Matt Domsch

megaraid: avoid 64/32 division when calculating BIOS CHS translation

parent 0698a955
...@@ -4065,7 +4065,7 @@ int megaraid_biosparam (struct scsi_device *sdev, struct block_device *bdev, ...@@ -4065,7 +4065,7 @@ int megaraid_biosparam (struct scsi_device *sdev, struct block_device *bdev,
/* Default heads (64) & sectors (32) */ /* Default heads (64) & sectors (32) */
heads = 64; heads = 64;
sectors = 32; sectors = 32;
cylinders = (unsigned long)capacity / (heads * sectors); cylinders = (unsigned long)capacity >> 11;
/* Handle extended translation size for logical drives > 1Gb */ /* Handle extended translation size for logical drives > 1Gb */
if (capacity >= 0x200000) { if (capacity >= 0x200000) {
...@@ -4153,7 +4153,7 @@ mega_partsize(struct block_device *bdev, sector_t capacity, int *geom) ...@@ -4153,7 +4153,7 @@ mega_partsize(struct block_device *bdev, sector_t capacity, int *geom)
return -1; return -1;
} }
cyls = capacity/(heads * sectors); cyls = (unsigned long)capacity/(heads * sectors);
geom[0] = heads; geom[0] = heads;
geom[1] = sectors; geom[1] = sectors;
......
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