* grub-core/commands/gptsync.c (lba_to_chs): Use proper types rather

than int.
This commit is contained in:
Vladimir Serbinenko 2013-10-25 18:02:40 +02:00
parent af81ed880d
commit a105d3755b
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/gptsync.c (lba_to_chs): Use proper types rather
than int.
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* conf/Makefile.common (CPPFLAGS_KERNEL): Add -DGRUB_KERNEL=1.

View File

@ -37,11 +37,11 @@ GRUB_MOD_LICENSE ("GPLv3+");
Is it a problem?
*/
static void
lba_to_chs (int lba, grub_uint8_t *cl, grub_uint8_t *ch,
lba_to_chs (grub_uint32_t lba, grub_uint8_t *cl, grub_uint8_t *ch,
grub_uint8_t *dh)
{
int cylinder, head, sector;
int sectors = 63, heads = 255, cylinders = 1024;
grub_uint32_t cylinder, head, sector;
grub_uint32_t sectors = 63, heads = 255, cylinders = 1024;
sector = lba % sectors + 1;
head = (lba / sectors) % heads;