diff options
author | David Howells <dhowells@redhat.com> | 2013-03-28 19:48:28 +0100 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-04-03 19:28:31 +0200 |
commit | 6a5d6943fe0e4b1e4c43c3aa1919360f68ae2f9a (patch) | |
tree | 9699df081c3ba3734dcca3fec525dc3d49e0e069 /drivers/usb/host | |
parent | USB: driver.c: processing failure, maching resume condition with suspend cond... (diff) | |
download | linux-6a5d6943fe0e4b1e4c43c3aa1919360f68ae2f9a.tar.xz linux-6a5d6943fe0e4b1e4c43c3aa1919360f68ae2f9a.zip |
xhci: Use ilog2() rather than __ffs() for calculating SEGMENT_SHIFT
Use ilog2() rather than __ffs() for calculating SEGMENT_SHIFT as ilog2() can
be worked out at compile time, whereas __ffs() must be calculated at runtime.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: linux-usb@vger.kernel.org
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/xhci.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 63582719e0fb..ca550ddb0b1d 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1239,7 +1239,7 @@ union xhci_trb { /* Allow two commands + a link TRB, along with any reserved command TRBs */ #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) #define SEGMENT_SIZE (TRBS_PER_SEGMENT*16) -#define SEGMENT_SHIFT (__ffs(SEGMENT_SIZE)) +#define SEGMENT_SHIFT (ilog2(SEGMENT_SIZE)) /* TRB buffer pointers can't cross 64KB boundaries */ #define TRB_MAX_BUFF_SHIFT 16 #define TRB_MAX_BUFF_SIZE (1 << TRB_MAX_BUFF_SHIFT) |