biosdisk: Add missing cast.

Found by: Coverity scan.
This commit is contained in:
Vladimir Serbinenko 2015-01-24 21:50:30 +01:00
parent 7656b72b17
commit d1130afa5f

View file

@ -382,7 +382,8 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
/* Some buggy BIOSes doesn't return the total sectors
correctly but returns zero. So if it is zero, compute
it by C/H/S returned by the LBA BIOS call. */
total_sectors = drp->cylinders * drp->heads * drp->sectors;
total_sectors = ((grub_uint64_t) drp->cylinders)
* drp->heads * drp->sectors;
if (drp->bytes_per_sector
&& !(drp->bytes_per_sector & (drp->bytes_per_sector - 1))
&& drp->bytes_per_sector >= 512
@ -425,7 +426,8 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
data->heads = 255;
if (! total_sectors)
total_sectors = data->cylinders * data->heads * data->sectors;
total_sectors = ((grub_uint64_t) data->cylinders)
* data->heads * data->sectors;
}
disk->total_sectors = total_sectors;