Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151433
b: refs/heads/master
c: 6071d83
h: refs/heads/master
i:
  151431: f201f2d
v: v3
  • Loading branch information
Sarah Sharp authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent 0003096 commit a38816b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7dd19e69d131ea34f74397559b422511e54d2911
refs/heads/master: 6071d8363b7b284038069f1795a98372fbc1a48e
13 changes: 6 additions & 7 deletions trunk/drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,15 @@
dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg,
union xhci_trb *trb)
{
dma_addr_t offset;
unsigned long segment_offset;

if (!seg || !trb || (void *) trb < (void *) seg->trbs)
if (!seg || !trb || trb < seg->trbs)
return 0;
/* offset in bytes, since these are byte-addressable */
offset = trb - seg->trbs;
/* SEGMENT_SIZE in bytes, trbs are 16-byte aligned */
if (offset > SEGMENT_SIZE || (offset % sizeof(*trb)) != 0)
/* offset in TRBs */
segment_offset = trb - seg->trbs;
if (segment_offset > TRBS_PER_SEGMENT)
return 0;
return seg->dma + offset;
return seg->dma + (segment_offset * sizeof(*trb));
}

/* Does this link TRB point to the first segment in a ring,
Expand Down

0 comments on commit a38816b

Please sign in to comment.