summaryrefslogtreecommitdiff
path: root/drivers/staging/octeon-usb
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2013-10-01 23:43:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-03 13:38:05 -0700
commite50aa24e79eca2bd3b09f1cfb9f149bfdff3eb4c (patch)
tree074ef1ba7f7c6f016db84d1cabeb79db218d993c /drivers/staging/octeon-usb
parente43de55ce23918920ec9c0f95fc07904469fdb46 (diff)
staging: octeon-usb: replace CVMX_CLZ with __fls()
Replace CVMX_CLZ macro with __fls(). Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/octeon-usb')
-rw-r--r--drivers/staging/octeon-usb/cvmx-usb.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/octeon-usb/cvmx-usb.c b/drivers/staging/octeon-usb/cvmx-usb.c
index 3dd732e7a738..c57e798cc072 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.c
+++ b/drivers/staging/octeon-usb/cvmx-usb.c
@@ -64,7 +64,6 @@
// normal prefetches that use the pref instruction
#define CVMX_PREFETCH_PREFX(X, address, offset) asm volatile ("pref %[type], %[off](%[rbase])" : : [rbase] "d" (address), [off] "I" (offset), [type] "n" (X))
#define CVMX_PREFETCH_PREF0(address, offset) CVMX_PREFETCH_PREFX(0, address, offset)
-#define CVMX_CLZ(result, input) asm ("clz %[rd],%[rs]" : [rd] "=d" (result) : [rs] "d" (input))
#define MAX_RETRIES 3 /* Maximum number of times to retry failed transactions */
#define MAX_PIPES 32 /* Maximum number of pipes that can be open at once */
@@ -1893,8 +1892,7 @@ static void __cvmx_usb_schedule(struct cvmx_usb_internal_state *usb, int is_sof)
while (usb->idle_hardware_channels) {
/* Find an idle channel */
- CVMX_CLZ(channel, usb->idle_hardware_channels);
- channel = 31 - channel;
+ channel = __fls(usb->idle_hardware_channels);
if (unlikely(channel > 7))
break;
@@ -3121,8 +3119,8 @@ int cvmx_usb_poll(struct cvmx_usb_state *state)
usbc_haint.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HAINT(usb->index));
while (usbc_haint.u32) {
int channel;
- CVMX_CLZ(channel, usbc_haint.u32);
- channel = 31 - channel;
+
+ channel = __fls(usbc_haint.u32);
__cvmx_usb_poll_channel(usb, channel);
usbc_haint.u32 ^= 1<<channel;
}