lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 20 May 2014 18:42:13 +0200
From:	Fabian Frederick <fabf@...net.be>
To:	linux-kernel <linux-kernel@...r.kernel.org>
Cc:	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	akpm <akpm@...ux-foundation.org>
Subject: [PATCH 1/1] drivers/video/fbdev/riva/riva_hw.c: replace shift loop
 by ilog2


Cc: Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@...net.be>
---
 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ