[SLOF] [PATCH] Fix format strings in usb-ohci.c

Alexey Kardashevskiy aik at ozlabs.ru
Mon Jan 11 12:05:57 AEDT 2016


On 01/09/2016 02:04 AM, Thomas Huth wrote:
> When compiling with OHCI_DEBUG enabled, gcc complains about a
> lot of bad format strings. So let's use more appropriate format
> modifiers to fix these warnings.
>
> Signed-off-by: Thomas Huth <thuth at redhat.com>

Thanks, applied.

but how exactly did you test it? "make qemu WARNFLAGS=-Wextra" did not 
produce any warning, with or without this patch, on gcc 5.1.1 and 5.2.1.



> ---
>   lib/libusb/usb-ohci.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/lib/libusb/usb-ohci.c b/lib/libusb/usb-ohci.c
> index 2547e02..d06c754 100644
> --- a/lib/libusb/usb-ohci.c
> +++ b/lib/libusb/usb-ohci.c
> @@ -254,7 +254,7 @@ static int ohci_alloc_pipe_pool(struct ohci_hcd *ohcd)
>   		return false;
>
>   	ohcd->pool_phys = opipe_phys = SLOF_dma_map_in(opipe, OHCI_PIPE_POOL_SIZE, true);
> -	dprintf("usb-ohci: %s opipe %x, opipe_phys %x size %d count %d\n",
> +	dprintf("usb-ohci: %s opipe %p, opipe_phys %lx size %ld count %d\n",
>   		__func__, opipe, opipe_phys, sizeof(*opipe), count);
>   	/* Although an array, link them*/
>   	for (i = 0, curr = opipe, prev = NULL; i < count; i++, curr++) {
> @@ -448,7 +448,7 @@ again:
>   	/* Interrupt is there, read from done_head pointer */
>   	td_phys = (struct ohci_td *)(uint64_t) le32_to_cpu(hcca->done_head);
>   	if (!td_phys) {
> -		dprintf("Again td_phys null %ld\n");
> +		dprintf("Again td_phys null\n");
>   		goto again;
>   	}
>   	hcca->done_head = 0;
> @@ -555,7 +555,7 @@ static int ohci_send_ctrl(struct usb_pipe *pipe, struct usb_dev_req *req, void *
>   	attr = EDA_FADDR(pipe->dev->addr) | EDA_MPS(pipe->mps) | EDA_SKIP;
>   	ohci_fill_ed(ed, PTR_U32(td_phys), td_next, attr, 0);
>   	ed->tailp = 0; /* HACK */
> -	dprintf("usb-ohci: %s - td_start %x td_end %x req %x\n", __func__,
> +	dprintf("usb-ohci: %s - td_start %p td_end %lx req %lx\n", __func__,
>   		td_phys, td_next, req_phys);
>   	mb();
>   	ed->attr &= cpu_to_le32(~EDA_SKIP);
> @@ -644,7 +644,7 @@ static int ohci_transfer_bulk(struct usb_pipe *pipe, void *td_ptr,
>
>   	td = tds = (struct ohci_td *) td_ptr;
>   	td_phys = (long)td_phys_ptr;
> -	dprintf("usb-ohci: %s pipe %p data_phys %p len %d DIR_IN %d td %p td_phys %p\n",
> +	dprintf("usb-ohci: %s pipe %p data_phys %p len %d DIR_IN %d td %p td_phys %lx\n",
>   		__func__, pipe, data_phys, datalen, dir, td, td_phys);
>
>   	if (!tds) {
> @@ -674,7 +674,7 @@ static int ohci_transfer_bulk(struct usb_pipe *pipe, void *td_ptr,
>   		| EDA_SKIP | pipe->dev->speed | EDA_EP(pipe->epno);
>   	td_next = ohci_get_td_phys(td, tds, td_phys);
>   	ohci_fill_ed(ed, td_phys, td_next, attr, 0);
> -	dprintf("usb-ohci: %s - tds %p td %p\n", __func__, td_phys, td_next);
> +	dprintf("usb-ohci: %s - tds %lx td %lx\n", __func__, td_phys, td_next);
>   	mb();
>   	ed->attr &= cpu_to_le32(~EDA_SKIP);
>
> @@ -780,7 +780,7 @@ static int ohci_get_pipe_intr(struct usb_pipe *pipe, struct ohci_hcd *ohcd,
>   		td->attr = cpu_to_le32(TDA_DP_IN | TDA_ROUNDING | TDA_CC);
>   		td->next_td = cpu_to_le32(td_next);
>   		td->be = cpu_to_le32(PTR_U32(ptr) + mps - 1);
> -		dprintf("td %x td++ %x ptr %x be %x\n",
> +		dprintf("td %p td++ %x ptr %p be %x\n",
>   			td, le32_to_cpu(td->next_td),
>   			ptr, (PTR_U32(ptr) + mps - 1));
>   	}
>


-- 
Alexey


More information about the SLOF mailing list