blob: 18ecee26655270c39ad823b39eead768da5918fb [file] [log] [blame]
From 78d15a9ca068a20a9884df7da237740b0cfac1ea Mon Sep 17 00:00:00 2001
From: Lu Baolu <baolu.lu@linux.intel.com>
Date: Fri, 7 Apr 2017 17:57:11 +0300
Subject: [PATCH 197/286] usb: xhci: refine xhci_decode_trb()
Replace 'TRB_FIELD_TO_TYPE(field3)' with 'type' to simplify
code.
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d2561626b9d126a94753ad6f048114bab702f02f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/usb/host/xhci.h | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -2144,7 +2144,7 @@ static inline const char *xhci_decode_tr
sprintf(str,
"LINK %08x%08x intr %d type '%s' flags %c:%c:%c:%c",
field1, field0, GET_INTR_TARGET(field2),
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field3 & TRB_IOC ? 'I' : 'i',
field3 & TRB_CHAIN ? 'C' : 'c',
field3 & TRB_TC ? 'T' : 't',
@@ -2165,7 +2165,7 @@ static inline const char *xhci_decode_tr
EVENT_TRB_LEN(field2), TRB_TO_SLOT_ID(field3),
/* Macro decrements 1, maybe it shouldn't?!? */
TRB_TO_EP_INDEX(field3) + 1,
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field3 & EVENT_DATA ? 'E' : 'e',
field3 & TRB_CYCLE ? 'C' : 'c');
@@ -2182,7 +2182,7 @@ static inline const char *xhci_decode_tr
(field1 & 0xff0000) >> 16,
TRB_LEN(field2), GET_TD_SIZE(field2),
GET_INTR_TARGET(field2),
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field3 & TRB_IDT ? 'I' : 'i',
field3 & TRB_IOC ? 'I' : 'i',
field3 & TRB_CYCLE ? 'C' : 'c');
@@ -2191,7 +2191,7 @@ static inline const char *xhci_decode_tr
sprintf(str, "Buffer %08x%08x length %d TD size %d intr %d type '%s' flags %c:%c:%c:%c:%c:%c:%c",
field1, field0, TRB_LEN(field2), GET_TD_SIZE(field2),
GET_INTR_TARGET(field2),
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field3 & TRB_IDT ? 'I' : 'i',
field3 & TRB_IOC ? 'I' : 'i',
field3 & TRB_CHAIN ? 'C' : 'c',
@@ -2204,7 +2204,7 @@ static inline const char *xhci_decode_tr
sprintf(str, "Buffer %08x%08x length %d TD size %d intr %d type '%s' flags %c:%c:%c:%c",
field1, field0, TRB_LEN(field2), GET_TD_SIZE(field2),
GET_INTR_TARGET(field2),
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field3 & TRB_IOC ? 'I' : 'i',
field3 & TRB_CHAIN ? 'C' : 'c',
field3 & TRB_ENT ? 'E' : 'e',
@@ -2218,7 +2218,7 @@ static inline const char *xhci_decode_tr
"Buffer %08x%08x length %d TD size %d intr %d type '%s' flags %c:%c:%c:%c:%c:%c:%c:%c",
field1, field0, TRB_LEN(field2), GET_TD_SIZE(field2),
GET_INTR_TARGET(field2),
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field3 & TRB_BEI ? 'B' : 'b',
field3 & TRB_IDT ? 'I' : 'i',
field3 & TRB_IOC ? 'I' : 'i',
@@ -2233,21 +2233,21 @@ static inline const char *xhci_decode_tr
case TRB_ENABLE_SLOT:
sprintf(str,
"%s: flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field3 & TRB_CYCLE ? 'C' : 'c');
break;
case TRB_DISABLE_SLOT:
case TRB_NEG_BANDWIDTH:
sprintf(str,
"%s: slot %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
TRB_TO_SLOT_ID(field3),
field3 & TRB_CYCLE ? 'C' : 'c');
break;
case TRB_ADDR_DEV:
sprintf(str,
"%s: ctx %08x%08x slot %d flags %c:%c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field1, field0,
TRB_TO_SLOT_ID(field3),
field3 & TRB_BSR ? 'B' : 'b',
@@ -2256,7 +2256,7 @@ static inline const char *xhci_decode_tr
case TRB_CONFIG_EP:
sprintf(str,
"%s: ctx %08x%08x slot %d flags %c:%c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field1, field0,
TRB_TO_SLOT_ID(field3),
field3 & TRB_DC ? 'D' : 'd',
@@ -2265,7 +2265,7 @@ static inline const char *xhci_decode_tr
case TRB_EVAL_CONTEXT:
sprintf(str,
"%s: ctx %08x%08x slot %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field1, field0,
TRB_TO_SLOT_ID(field3),
field3 & TRB_CYCLE ? 'C' : 'c');
@@ -2273,7 +2273,7 @@ static inline const char *xhci_decode_tr
case TRB_RESET_EP:
sprintf(str,
"%s: ctx %08x%08x slot %d ep %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field1, field0,
TRB_TO_SLOT_ID(field3),
/* Macro decrements 1, maybe it shouldn't?!? */
@@ -2283,7 +2283,7 @@ static inline const char *xhci_decode_tr
case TRB_STOP_RING:
sprintf(str,
"%s: slot %d sp %d ep %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
TRB_TO_SLOT_ID(field3),
TRB_TO_SUSPEND_PORT(field3),
/* Macro decrements 1, maybe it shouldn't?!? */
@@ -2293,7 +2293,7 @@ static inline const char *xhci_decode_tr
case TRB_SET_DEQ:
sprintf(str,
"%s: deq %08x%08x stream %d slot %d ep %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field1, field0,
TRB_TO_STREAM_ID(field2),
TRB_TO_SLOT_ID(field3),
@@ -2304,14 +2304,14 @@ static inline const char *xhci_decode_tr
case TRB_RESET_DEV:
sprintf(str,
"%s: slot %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
TRB_TO_SLOT_ID(field3),
field3 & TRB_CYCLE ? 'C' : 'c');
break;
case TRB_FORCE_EVENT:
sprintf(str,
"%s: event %08x%08x vf intr %d vf id %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field1, field0,
TRB_TO_VF_INTR_TARGET(field2),
TRB_TO_VF_ID(field3),
@@ -2320,14 +2320,14 @@ static inline const char *xhci_decode_tr
case TRB_SET_LT:
sprintf(str,
"%s: belt %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
TRB_TO_BELT(field3),
field3 & TRB_CYCLE ? 'C' : 'c');
break;
case TRB_GET_BW:
sprintf(str,
"%s: ctx %08x%08x slot %d speed %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field1, field0,
TRB_TO_SLOT_ID(field3),
TRB_TO_DEV_SPEED(field3),
@@ -2336,7 +2336,7 @@ static inline const char *xhci_decode_tr
case TRB_FORCE_HEADER:
sprintf(str,
"%s: info %08x%08x%08x pkt type %d roothub port %d flags %c",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field2, field1, field0 & 0xffffffe0,
TRB_TO_PACKET_TYPE(field0),
TRB_TO_ROOTHUB_PORT(field3),
@@ -2345,7 +2345,7 @@ static inline const char *xhci_decode_tr
default:
sprintf(str,
"type '%s' -> raw %08x %08x %08x %08x",
- xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)),
+ xhci_trb_type_string(type),
field0, field1, field2, field3);
}