public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xhci: Use ilog2() rather than __ffs() for calculating SEGMENT_SHIFT
@ 2013-03-28 18:48 David Howells
  2013-03-28 18:48 ` [PATCH 2/2] xhci: Rename SEGMENT_SIZE and SEGMENT_SHIFT as the former is used in a.out.h David Howells
  0 siblings, 1 reply; 7+ messages in thread
From: David Howells @ 2013-03-28 18:48 UTC (permalink / raw)
  To: sarah.a.sharp; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel

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
---

 drivers/usb/host/xhci.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 2c510e4..558ba50 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1235,7 +1235,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)


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-02 19:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 18:48 [PATCH 1/2] xhci: Use ilog2() rather than __ffs() for calculating SEGMENT_SHIFT David Howells
2013-03-28 18:48 ` [PATCH 2/2] xhci: Rename SEGMENT_SIZE and SEGMENT_SHIFT as the former is used in a.out.h David Howells
2013-03-28 20:15   ` Sarah Sharp
2013-03-28 22:32     ` David Howells
2013-03-29  0:10       ` Sarah Sharp
2013-04-02 18:07         ` David Howells
2013-04-02 19:37           ` Sarah Sharp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox