diff options
author | Andiry Xu <andiry.xu@amd.com> | 2010-05-10 22:57:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:44 -0400 |
commit | 54b5acf3acb7a1f83ec281d111d3e2812cd7ad9d (patch) | |
tree | 3f1e2ea5fdbf9178799b503d1d087455183b9b76 /drivers | |
parent | 6c12db90f19727c76990e7f4801c67a148b30111 (diff) |
USB: xHCI: Fix wrong usage of macro TRB_TYPE
Macro TRB_TYPE is misused in some places. Fix the wrong usage.
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 803f6810e996..eabd95544823 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -390,7 +390,8 @@ static struct xhci_segment *find_trb_seg( | |||
390 | while (cur_seg->trbs > trb || | 390 | while (cur_seg->trbs > trb || |
391 | &cur_seg->trbs[TRBS_PER_SEGMENT - 1] < trb) { | 391 | &cur_seg->trbs[TRBS_PER_SEGMENT - 1] < trb) { |
392 | generic_trb = &cur_seg->trbs[TRBS_PER_SEGMENT - 1].generic; | 392 | generic_trb = &cur_seg->trbs[TRBS_PER_SEGMENT - 1].generic; |
393 | if (TRB_TYPE(generic_trb->field[3]) == TRB_LINK && | 393 | if ((generic_trb->field[3] & TRB_TYPE_BITMASK) == |
394 | TRB_TYPE(TRB_LINK) && | ||
394 | (generic_trb->field[3] & LINK_TOGGLE)) | 395 | (generic_trb->field[3] & LINK_TOGGLE)) |
395 | *cycle_state = ~(*cycle_state) & 0x1; | 396 | *cycle_state = ~(*cycle_state) & 0x1; |
396 | cur_seg = cur_seg->next; | 397 | cur_seg = cur_seg->next; |
@@ -455,7 +456,7 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, | |||
455 | BUG(); | 456 | BUG(); |
456 | 457 | ||
457 | trb = &state->new_deq_ptr->generic; | 458 | trb = &state->new_deq_ptr->generic; |
458 | if (TRB_TYPE(trb->field[3]) == TRB_LINK && | 459 | if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) && |
459 | (trb->field[3] & LINK_TOGGLE)) | 460 | (trb->field[3] & LINK_TOGGLE)) |
460 | state->new_cycle_state = ~(state->new_cycle_state) & 0x1; | 461 | state->new_cycle_state = ~(state->new_cycle_state) & 0x1; |
461 | next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); | 462 | next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); |
@@ -1504,8 +1505,10 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
1504 | for (cur_trb = ep_ring->dequeue, cur_seg = ep_ring->deq_seg; | 1505 | for (cur_trb = ep_ring->dequeue, cur_seg = ep_ring->deq_seg; |
1505 | cur_trb != event_trb; | 1506 | cur_trb != event_trb; |
1506 | next_trb(xhci, ep_ring, &cur_seg, &cur_trb)) { | 1507 | next_trb(xhci, ep_ring, &cur_seg, &cur_trb)) { |
1507 | if (TRB_TYPE(cur_trb->generic.field[3]) != TRB_TR_NOOP && | 1508 | if ((cur_trb->generic.field[3] & |
1508 | TRB_TYPE(cur_trb->generic.field[3]) != TRB_LINK) | 1509 | TRB_TYPE_BITMASK) != TRB_TYPE(TRB_TR_NOOP) && |
1510 | (cur_trb->generic.field[3] & | ||
1511 | TRB_TYPE_BITMASK) != TRB_TYPE(TRB_LINK)) | ||
1509 | td->urb->actual_length += | 1512 | td->urb->actual_length += |
1510 | TRB_LEN(cur_trb->generic.field[2]); | 1513 | TRB_LEN(cur_trb->generic.field[2]); |
1511 | } | 1514 | } |