diff options
author | Matt Evans <matt@ozlabs.org> | 2011-05-31 20:22:55 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-06-02 19:37:47 -0400 |
commit | f5960b698eb50a39fce1a066dc19a6a5a1148e16 (patch) | |
tree | d1f08656be5ffd40f4268d874801f91016508e3e /drivers/usb/host/xhci-dbg.c | |
parent | 55922c9d1b84b89cb946c777fddccb3247e7df2c (diff) |
xhci: Remove some unnecessary casts and tidy some endian swap code
Some of the recently-added cpu_to_leXX and leXX_to_cpu made things somewhat
messy; this patch neatens some of these areas, removing unnecessary casts
in those parts also. In some places (where Y & Z are constants) a
comparison of (leXX_to_cpu(X) & Y) == Z has been replaced with
(X & cpu_to_leXX(Y)) == cpu_to_leXX(Z). The endian reversal of the
constants should wash out at compile time.
Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-dbg.c')
-rw-r--r-- | drivers/usb/host/xhci-dbg.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c index 2e0486178dbe..17d3e359ca62 100644 --- a/drivers/usb/host/xhci-dbg.c +++ b/drivers/usb/host/xhci-dbg.c | |||
@@ -266,11 +266,11 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb) | |||
266 | xhci_dbg(xhci, "Interrupter target = 0x%x\n", | 266 | xhci_dbg(xhci, "Interrupter target = 0x%x\n", |
267 | GET_INTR_TARGET(le32_to_cpu(trb->link.intr_target))); | 267 | GET_INTR_TARGET(le32_to_cpu(trb->link.intr_target))); |
268 | xhci_dbg(xhci, "Cycle bit = %u\n", | 268 | xhci_dbg(xhci, "Cycle bit = %u\n", |
269 | (unsigned int) (le32_to_cpu(trb->link.control) & TRB_CYCLE)); | 269 | le32_to_cpu(trb->link.control) & TRB_CYCLE); |
270 | xhci_dbg(xhci, "Toggle cycle bit = %u\n", | 270 | xhci_dbg(xhci, "Toggle cycle bit = %u\n", |
271 | (unsigned int) (le32_to_cpu(trb->link.control) & LINK_TOGGLE)); | 271 | le32_to_cpu(trb->link.control) & LINK_TOGGLE); |
272 | xhci_dbg(xhci, "No Snoop bit = %u\n", | 272 | xhci_dbg(xhci, "No Snoop bit = %u\n", |
273 | (unsigned int) (le32_to_cpu(trb->link.control) & TRB_NO_SNOOP)); | 273 | le32_to_cpu(trb->link.control) & TRB_NO_SNOOP); |
274 | break; | 274 | break; |
275 | case TRB_TYPE(TRB_TRANSFER): | 275 | case TRB_TYPE(TRB_TRANSFER): |
276 | address = le64_to_cpu(trb->trans_event.buffer); | 276 | address = le64_to_cpu(trb->trans_event.buffer); |
@@ -284,9 +284,9 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb) | |||
284 | address = le64_to_cpu(trb->event_cmd.cmd_trb); | 284 | address = le64_to_cpu(trb->event_cmd.cmd_trb); |
285 | xhci_dbg(xhci, "Command TRB pointer = %llu\n", address); | 285 | xhci_dbg(xhci, "Command TRB pointer = %llu\n", address); |
286 | xhci_dbg(xhci, "Completion status = %u\n", | 286 | xhci_dbg(xhci, "Completion status = %u\n", |
287 | (unsigned int) GET_COMP_CODE(le32_to_cpu(trb->event_cmd.status))); | 287 | GET_COMP_CODE(le32_to_cpu(trb->event_cmd.status))); |
288 | xhci_dbg(xhci, "Flags = 0x%x\n", | 288 | xhci_dbg(xhci, "Flags = 0x%x\n", |
289 | (unsigned int) le32_to_cpu(trb->event_cmd.flags)); | 289 | le32_to_cpu(trb->event_cmd.flags)); |
290 | break; | 290 | break; |
291 | default: | 291 | default: |
292 | xhci_dbg(xhci, "Unknown TRB with TRB type ID %u\n", | 292 | xhci_dbg(xhci, "Unknown TRB with TRB type ID %u\n", |
@@ -318,10 +318,10 @@ void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg) | |||
318 | for (i = 0; i < TRBS_PER_SEGMENT; ++i) { | 318 | for (i = 0; i < TRBS_PER_SEGMENT; ++i) { |
319 | trb = &seg->trbs[i]; | 319 | trb = &seg->trbs[i]; |
320 | xhci_dbg(xhci, "@%016llx %08x %08x %08x %08x\n", addr, | 320 | xhci_dbg(xhci, "@%016llx %08x %08x %08x %08x\n", addr, |
321 | (u32)lower_32_bits(le64_to_cpu(trb->link.segment_ptr)), | 321 | lower_32_bits(le64_to_cpu(trb->link.segment_ptr)), |
322 | (u32)upper_32_bits(le64_to_cpu(trb->link.segment_ptr)), | 322 | upper_32_bits(le64_to_cpu(trb->link.segment_ptr)), |
323 | (unsigned int) le32_to_cpu(trb->link.intr_target), | 323 | le32_to_cpu(trb->link.intr_target), |
324 | (unsigned int) le32_to_cpu(trb->link.control)); | 324 | le32_to_cpu(trb->link.control)); |
325 | addr += sizeof(*trb); | 325 | addr += sizeof(*trb); |
326 | } | 326 | } |
327 | } | 327 | } |
@@ -402,8 +402,8 @@ void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst) | |||
402 | addr, | 402 | addr, |
403 | lower_32_bits(le64_to_cpu(entry->seg_addr)), | 403 | lower_32_bits(le64_to_cpu(entry->seg_addr)), |
404 | upper_32_bits(le64_to_cpu(entry->seg_addr)), | 404 | upper_32_bits(le64_to_cpu(entry->seg_addr)), |
405 | (unsigned int) le32_to_cpu(entry->seg_size), | 405 | le32_to_cpu(entry->seg_size), |
406 | (unsigned int) le32_to_cpu(entry->rsvd)); | 406 | le32_to_cpu(entry->rsvd)); |
407 | addr += sizeof(*entry); | 407 | addr += sizeof(*entry); |
408 | } | 408 | } |
409 | } | 409 | } |