[PATCH 1/1] drivers/video/fbdev/riva/riva_hw.c: replace shift loop by ilog2

From: Fabian Frederick
Date: Tue May 20 2014 - 12:42:19 EST



Cc: Jean-Christophe Plagniol-Villard <plagnioj@xxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
drivers/video/fbdev/riva/riva_hw.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c
index 78fdbf5..dae3504 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -640,9 +640,7 @@ static void nv3UpdateArbitrationSettings
if (fifo_data.valid)
{
int b = fifo_data.graphics_burst_size >> 4;
- *burst = 0;
- while (b >>= 1)
- (*burst)++;
+ *burst = ilog2(b);
*lwm = fifo_data.graphics_lwm >> 3;
}
else
@@ -831,9 +829,7 @@ static void nv4UpdateArbitrationSettings
if (fifo_data.valid)
{
int b = fifo_data.graphics_burst_size >> 4;
- *burst = 0;
- while (b >>= 1)
- (*burst)++;
+ *burst = ilog2(b);
*lwm = fifo_data.graphics_lwm >> 3;
}
}
@@ -1096,9 +1092,7 @@ static void nv10UpdateArbitrationSettings
if (fifo_data.valid)
{
int b = fifo_data.graphics_burst_size >> 4;
- *burst = 0;
- while (b >>= 1)
- (*burst)++;
+ *burst = ilog2(b);
*lwm = fifo_data.graphics_lwm >> 3;
}
}
@@ -1150,9 +1144,7 @@ static void nForceUpdateArbitrationSettings
if (fifo_data.valid)
{
int b = fifo_data.graphics_burst_size >> 4;
- *burst = 0;
- while (b >>= 1)
- (*burst)++;
+ *burst = ilog2(b);
*lwm = fifo_data.graphics_lwm >> 3;
}
}
--
1.8.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/