From 9af6dac30d32fd7174ea297ffdf90efbb3fefdc0 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 19 Sep 2010 22:05:48 +0200 Subject: [PATCH] * grub-core/bus/usb/ohci.c (grub_ohci_cancel_transfer): Use %p to print pointer. * grub-core/bus/usb/uhci.c: Remove empty define. (grub_uhci_check_transfer): Add missing cast. * grub-core/bus/usb/usbhub.c (poll_nonroot_hub): Use %p to print pointer. * grub-core/term/usb_keyboard.c (grub_usb_keyboard_getkey): Use PRIuGRUB_SIZE. * include/grub/types.h (PRIuGRUB_SIZE): New definition. --- ChangeLog | 12 ++++++++++++ grub-core/bus/usb/ohci.c | 4 ++-- grub-core/bus/usb/uhci.c | 2 +- grub-core/bus/usb/usbhub.c | 4 ++-- grub-core/term/usb_keyboard.c | 3 ++- include/grub/types.h | 3 +++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02f773531..3811381ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-09-19 Vladimir Serbinenko + + * grub-core/bus/usb/ohci.c (grub_ohci_cancel_transfer): Use %p to + print pointer. + * grub-core/bus/usb/uhci.c: Remove empty define. + (grub_uhci_check_transfer): Add missing cast. + * grub-core/bus/usb/usbhub.c (poll_nonroot_hub): Use %p to + print pointer. + * grub-core/term/usb_keyboard.c (grub_usb_keyboard_getkey): Use + PRIuGRUB_SIZE. + * include/grub/types.h (PRIuGRUB_SIZE): New definition. + 2010-09-19 Vladimir Serbinenko * grub-core/Makefile.core.def (legacycfg): Add diff --git a/grub-core/bus/usb/ohci.c b/grub-core/bus/usb/ohci.c index b07e30403..bf5aaa7c0 100644 --- a/grub-core/bus/usb/ohci.c +++ b/grub-core/bus/usb/ohci.c @@ -1192,8 +1192,8 @@ grub_ohci_cancel_transfer (grub_usb_controller_t dev, tderr_virt = grub_ohci_td_phys2virt (o,cdata-> tderr_phys); - grub_dprintf ("ohci", "Cancel: tderr_phys=0x%08x, tderr_virt=0x%08x\n", - cdata->tderr_phys, (unsigned int)tderr_virt); + grub_dprintf ("ohci", "Cancel: tderr_phys=0x%x, tderr_virt=%p\n", + cdata->tderr_phys, tderr_virt); if (tderr_virt) transfer->last_trans = tderr_virt->tr_index; diff --git a/grub-core/bus/usb/uhci.c b/grub-core/bus/usb/uhci.c index 4bf84a8f8..711d87d86 100644 --- a/grub-core/bus/usb/uhci.c +++ b/grub-core/bus/usb/uhci.c @@ -550,7 +550,7 @@ grub_uhci_check_transfer (grub_usb_controller_t dev, *actual = 0; - errtd = (grub_uhci_td_t) (cdata->qh->elinkptr & ~0x0f); + errtd = (grub_uhci_td_t) (grub_addr_t) (cdata->qh->elinkptr & ~0x0f); grub_dprintf ("uhci", ">t status=0x%02x data=0x%02x td=%p\n", errtd->ctrl_status, errtd->buffer & (~15), errtd); diff --git a/grub-core/bus/usb/usbhub.c b/grub-core/bus/usb/usbhub.c index 73d233642..2a5cc3be9 100644 --- a/grub-core/bus/usb/usbhub.c +++ b/grub-core/bus/usb/usbhub.c @@ -350,8 +350,8 @@ poll_nonroot_hub (grub_usb_device_t dev) GRUB_USB_REQ_GET_STATUS, 0, i, sizeof (status), (char *) &status); - grub_printf ("dev = 0x%0x, i = %d, status = %08x\n", - (unsigned int) dev, i, status); + grub_printf ("dev = %p, i = %d, status = %08x\n", + dev, i, status); if (err) continue; diff --git a/grub-core/term/usb_keyboard.c b/grub-core/term/usb_keyboard.c index 8a34ec552..30ed8f9c2 100644 --- a/grub-core/term/usb_keyboard.c +++ b/grub-core/term/usb_keyboard.c @@ -404,7 +404,8 @@ grub_usb_keyboard_getkey (struct grub_term_input *term) termdata->last_key = -1; grub_dprintf ("usb_keyboard", - "err = %d, actual = %d report: 0x%02x 0x%02x 0x%02x 0x%02x" + "err = %d, actual = %" PRIuGRUB_SIZE + " report: 0x%02x 0x%02x 0x%02x 0x%02x" " 0x%02x 0x%02x 0x%02x 0x%02x\n", err, actual, termdata->current_report[0], termdata->current_report[1], diff --git a/include/grub/types.h b/include/grub/types.h index 766eddf07..221fef3c0 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -101,8 +101,10 @@ typedef grub_int64_t grub_ssize_t; # if GRUB_CPU_SIZEOF_LONG == 8 # define PRIxGRUB_SIZE "lx" +# define PRIuGRUB_SIZE "lu" # else # define PRIxGRUB_SIZE "llx" +# define PRIuGRUB_SIZE "llu" # endif #else typedef grub_uint32_t grub_addr_t; @@ -110,6 +112,7 @@ typedef grub_uint32_t grub_size_t; typedef grub_int32_t grub_ssize_t; # define PRIxGRUB_SIZE "x" +# define PRIuGRUB_SIZE "u" #endif #if GRUB_CPU_SIZEOF_LONG == 8