[PATCH v3 02/14] usb: dwc2: Add host controller driver

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Jul 22 05:18:39 EDT 2020


On 7/22/20 11:12 AM, Jules Maselbas wrote:
> On Wed, Jul 22, 2020 at 08:36:25AM +0200, Ahmad Fatoum wrote:
>> On 7/21/20 2:05 PM, Jules Maselbas wrote:
>>> +static int transfer_chunk(struct dwc2 *dwc2, u8 hc,
>>> +			  u8 *pid, int in, void *buffer, int num_packets,
>>> +			  int xfer_len, int *actual_len, int odd_frame)
>>> +{
>>> +	uint32_t hctsiz, hcchar, sub;
>>> +	dma_addr_t dma_addr;
>>> +	int ret = 0;
>>> +
>>> +	dma_addr = dma_map_single(dwc2->dev, buffer, xfer_len,
>>> +				  in ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
>>> +
>>> +	dwc2_dbg(dwc2, "chunk: pid=%d xfer_len=%u pkts=%u dma_addr=%llx\n",
>>> +			*pid, xfer_len, num_packets, dma_addr);
>>
>> Use %da for printing dma_addr, otherwise on 32-bit builds with #define DEBUG,
>> garbage would be read here.
> Yup sounds good, from what i've seen in vsprintf.c it's '%ad' to print
> dma_addr_t.

Sorry, I misread the code.
Apparently, it's neither. It should be %pad for dma_addr_t.

> 
> I will also modify gadget.c with the following:
> -               dwc2_dbg(dwc2, "%s: 0x%p => 0x%08x\n",
> -                        __func__, (void *)ureq->dma, dma_reg);
> +               dwc2_dbg(dwc2, "%s: 0x%ad => 0x%08x\n",
> +                        __func__, ureq->dma, dma_reg);
> 
>  
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list