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

Jules Maselbas jmaselbas at kalray.eu
Wed Jul 22 05:12:35 EDT 2020


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.

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);

 



More information about the barebox mailing list