Changeset 4125b7d in mainline for uspace/drv/ohci


Ignore:
Timestamp:
2011-04-18T20:06:55Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
84a04dd, bbdf09e
Parents:
5ab4a48
Message:

usb_log_printf() checks for printf correctness

It is surprising how many printf warnings simple check could
produce ;-).

Next time, it won't compile. Bad, huh?

Location:
uspace/drv/ohci
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/batch.c

    r5ab4a48 r4125b7d  
    141141        assert(data);
    142142        size_t tds = data->td_count;
    143         usb_log_debug("Batch(%p) checking %d td(s) for completion.\n",
     143        usb_log_debug("Batch(%p) checking %zu td(s) for completion.\n",
    144144            instance, tds);
    145145        usb_log_debug("ED: %x:%x:%x:%x.\n",
     
    150150        for (; i < tds; ++i) {
    151151                assert(data->tds[i] != NULL);
    152                 usb_log_debug("TD %d: %x:%x:%x:%x.\n", i,
     152                usb_log_debug("TD %zu: %x:%x:%x:%x.\n", i,
    153153                    data->tds[i]->status, data->tds[i]->cbp, data->tds[i]->next,
    154154                    data->tds[i]->be);
     
    158158                instance->error = td_error(data->tds[i]);
    159159                if (instance->error != EOK) {
    160                         usb_log_debug("Batch(%p) found error TD(%d):%x.\n",
     160                        usb_log_debug("Batch(%p) found error TD(%zu):%x.\n",
    161161                            instance, i, data->tds[i]->status);
    162162                        /* Make sure TD queue is empty (one TD),
  • uspace/drv/ohci/endpoint_list.c

    r5ab4a48 r4125b7d  
    5555        }
    5656        instance->list_head_pa = addr_to_phys(instance->list_head);
    57         usb_log_debug2("Transfer list %s setup with ED: %p(%p).\n",
     57        usb_log_debug2("Transfer list %s setup with ED: %p(0x%0" PRIx32 ")).\n",
    5858            name, instance->list_head, instance->list_head_pa);
    5959
     
    121121                hcd_ep, instance->name, first, first->ed);
    122122        if (last_ed == instance->list_head) {
    123                 usb_log_debug2("%s head ED(%p-%p): %x:%x:%x:%x.\n",
     123                usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x:%x:%x.\n",
    124124                    instance->name, last_ed, instance->list_head_pa,
    125125                    last_ed->status, last_ed->td_tail, last_ed->td_head,
  • uspace/drv/ohci/hc.c

    r5ab4a48 r4125b7d  
    113113            BANDWIDTH_AVAILABLE_USB11);
    114114        CHECK_RET_RETURN(ret, "Failed to initialize endpoint manager: %s.\n",
    115             ret, str_error(ret));
     115            str_error(ret));
    116116
    117117        hc_gain_control(instance);
    118118        ret = hc_init_memory(instance);
    119         CHECK_RET_RETURN(ret, "Failed to create OHCI memory structures:%s.\n",
    120             ret, str_error(ret));
     119        CHECK_RET_RETURN(ret, "Failed to create OHCI memory structures: %s.\n",
     120            str_error(ret));
    121121        hc_init_hw(instance);
    122122        fibril_mutex_initialize(&instance->guard);
     
    294294        if (status & IS_WDH) {
    295295                fibril_mutex_lock(&instance->guard);
    296                 usb_log_debug2("HCCA: %p-%p(%p).\n", instance->hcca,
    297                     instance->registers->hcca, addr_to_phys(instance->hcca));
    298                 usb_log_debug2("Periodic current: %p.\n",
     296                usb_log_debug2("HCCA: %p-%#" PRIx32 " (%p).\n", instance->hcca,
     297                    instance->registers->hcca,
     298                    (void *) addr_to_phys(instance->hcca));
     299                usb_log_debug2("Periodic current: %#" PRIx32 ".\n",
    299300                    instance->registers->periodic_current);
    300301
     
    405406        instance->registers->bulk_head =
    406407            instance->lists[USB_TRANSFER_BULK].list_head_pa;
    407         usb_log_debug2("Bulk HEAD set to: %p(%p).\n",
     408        usb_log_debug2("Bulk HEAD set to: %p (%#" PRIx32 ").\n",
    408409            instance->lists[USB_TRANSFER_BULK].list_head,
    409410            instance->lists[USB_TRANSFER_BULK].list_head_pa);
     
    411412        instance->registers->control_head =
    412413            instance->lists[USB_TRANSFER_CONTROL].list_head_pa;
    413         usb_log_debug2("Control HEAD set to: %p(%p).\n",
     414        usb_log_debug2("Control HEAD set to: %p (%#" PRIx32 ").\n",
    414415            instance->lists[USB_TRANSFER_CONTROL].list_head,
    415416            instance->lists[USB_TRANSFER_CONTROL].list_head_pa);
     
    487488                    instance->lists[USB_TRANSFER_INTERRUPT].list_head_pa;
    488489        }
    489         usb_log_debug2("Interrupt HEADs set to: %p(%p).\n",
     490        usb_log_debug2("Interrupt HEADs set to: %p (%#" PRIx32 ").\n",
    490491            instance->lists[USB_TRANSFER_INTERRUPT].list_head,
    491492            instance->lists[USB_TRANSFER_INTERRUPT].list_head_pa);
  • uspace/drv/ohci/iface.c

    r5ab4a48 r4125b7d  
    118118        hc_t *hc = fun_to_hc(fun);
    119119        assert(hc);
    120         usb_log_debug("Address bind %d-%d.\n", address, handle);
     120        usb_log_debug("Address bind %d-%" PRIun ".\n", address, handle);
    121121        usb_device_keeper_bind(&hc->manager, address, handle);
    122122        return EOK;
  • uspace/drv/ohci/ohci.c

    r5ab4a48 r4125b7d  
    148148            pci_get_my_registers(device, &mem_reg_base, &mem_reg_size, &irq);
    149149        CHECK_RET_DEST_FUN_RETURN(ret,
    150             "Failed(%d) to get memory addresses:.\n", ret, device->handle);
    151         usb_log_debug("Memory mapped regs at 0x%X (size %zu), IRQ %d.\n",
    152             mem_reg_base, mem_reg_size, irq);
     150            "Failed to get memory addresses for %" PRIun ": %s.\n",
     151            device->handle, str_error(ret));
     152        usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.\n",
     153            (void *) mem_reg_base, mem_reg_size, irq);
    153154
    154155        ret = pci_disable_legacy(device);
  • uspace/drv/ohci/pci.c

    r5ab4a48 r4125b7d  
    117117                                mem_address = res->res.mem_range.address;
    118118                                mem_size = res->res.mem_range.size;
    119                                 usb_log_debug2("Found mem: %llx %zu.\n",
    120                                     mem_address, mem_size);
     119                                usb_log_debug2("Found mem: %p %zu.\n",
     120                                    (void *) mem_address, mem_size);
    121121                                mem_found = true;
    122122                                }
Note: See TracChangeset for help on using the changeset viewer.