Hi, On Tue, Sep 27, 2011 at 10:53:32PM -0700, Paul Zimmerman wrote: > Fix offset calculation in dwc3_trb_dma_offset() > > Signed-off-by: Paul Zimmerman <paulz@xxxxxxxxxxxx> > --- > drivers/usb/dwc3/gadget.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index 5283956..2c68934 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -189,7 +189,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep, > static dma_addr_t dwc3_trb_dma_offset(struct dwc3_ep *dep, > struct dwc3_trb_hw *trb) > { > - u32 offset = trb - dep->trb_pool; > + u32 offset = (char *)trb - (char *)dep->trb_pool; Have you really seen anything wrong with this ? Also, I'm not sure a char would be good here. Maybe unsigned long would be better. Also, don't change the alignment :-) -- balbi
Attachment:
signature.asc
Description: Digital signature