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.h | |
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.h')
-rw-r--r-- | drivers/usb/host/xhci.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ac0196e7fcf1..f9098a24d38b 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1065,6 +1065,13 @@ union xhci_trb { | |||
1065 | /* Get NEC firmware revision. */ | 1065 | /* Get NEC firmware revision. */ |
1066 | #define TRB_NEC_GET_FW 49 | 1066 | #define TRB_NEC_GET_FW 49 |
1067 | 1067 | ||
1068 | #define TRB_TYPE_LINK(x) (((x) & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK)) | ||
1069 | /* Above, but for __le32 types -- can avoid work by swapping constants: */ | ||
1070 | #define TRB_TYPE_LINK_LE32(x) (((x) & cpu_to_le32(TRB_TYPE_BITMASK)) == \ | ||
1071 | cpu_to_le32(TRB_TYPE(TRB_LINK))) | ||
1072 | #define TRB_TYPE_NOOP_LE32(x) (((x) & cpu_to_le32(TRB_TYPE_BITMASK)) == \ | ||
1073 | cpu_to_le32(TRB_TYPE(TRB_TR_NOOP))) | ||
1074 | |||
1068 | #define NEC_FW_MINOR(p) (((p) >> 0) & 0xff) | 1075 | #define NEC_FW_MINOR(p) (((p) >> 0) & 0xff) |
1069 | #define NEC_FW_MAJOR(p) (((p) >> 8) & 0xff) | 1076 | #define NEC_FW_MAJOR(p) (((p) >> 8) & 0xff) |
1070 | 1077 | ||