Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a5d6943 authored by David Howells's avatar David Howells Committed by Sarah Sharp
Browse files

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: default avatarDavid 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: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 505bdbc7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)