+2009-04-29 David S. Miller <davem@davemloft.net>
+
+ * commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf
+ warnings.
+ * kern/ieee1275/openfw.c (grub_claimmap): Likewise.
+ * disk/ieee1275/ofdisk.c (grub_ofdisk_open, grub_ofdisk_close,
+ grub_ofdisk_read): Likewise, and deal similarly with the fact that
+ ihandles have a 32-bit type but need to be stored in a "void *".
+
2009-04-28 Pavel Roskin <proski@gnu.org>
* disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev,
goto fail;
}
- grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath, (void *) dev_ihandle);
+ grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath,
+ (void *) (unsigned long) dev_ihandle);
if (grub_ieee1275_finddevice (op->devpath, &dev))
{
/* XXX: Read this, somehow. */
disk->has_partitions = 1;
- disk->data = (void *) dev_ihandle;
+ disk->data = (void *) (unsigned long) dev_ihandle;
return 0;
fail:
{
grub_dprintf ("disk", "Closing handle %p.\n",
(void *) disk->data);
- grub_ieee1275_close ((grub_ieee1275_ihandle_t) disk->data);
+ grub_ieee1275_close ((grub_ieee1275_ihandle_t) (unsigned long) disk->data);
}
static grub_err_t
grub_dprintf ("disk",
"Reading handle %p: sector 0x%llx, size 0x%lx, buf %p.\n",
- (void *) disk->data, sector, (long) size, buf);
+ (void *) disk->data, (long long) sector, (long) size, buf);
pos = sector * 512UL;
- grub_ieee1275_seek ((grub_ieee1275_ihandle_t) disk->data, (int) (pos >> 32),
- (int) pos & 0xFFFFFFFFUL, &status);
+ grub_ieee1275_seek ((grub_ieee1275_ihandle_t) (unsigned long) disk->data,
+ (int) (pos >> 32), (int) pos & 0xFFFFFFFFUL, &status);
if (status < 0)
return grub_error (GRUB_ERR_READ_ERROR,
"Seek error, can't seek block %llu",
- sector);
- grub_ieee1275_read ((grub_ieee1275_ihandle_t) disk->data, buf,
- size * 512UL, &actual);
+ (long long) sector);
+ grub_ieee1275_read ((grub_ieee1275_ihandle_t) (unsigned long) disk->data,
+ buf, size * 512UL, &actual);
if (actual != actual)
return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu",
- sector);
+ (long long) sector);
return 0;
}
if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE)
&& grub_map (addr, addr, size, 0x00))
{
- grub_printf ("map failed: address 0x%x, size 0x%x\n", addr, size);
+ grub_printf ("map failed: address 0x%llx, size 0x%llx\n",
+ (long long) addr, (long long) size);
grub_ieee1275_release (addr, size);
return -1;
}