Replacing (n & (n-1)) in the context of power of 2 checks
with is_power_of_2

Signed-off-by: vignesh babu <[EMAIL PROTECTED]>
--- 
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index c113458..f6c35a3 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -34,6 +34,7 @@
  */
 
 #include <linux/vmalloc.h>
+#include <linux/log2.h>
 #include "drmP.h"
 
 unsigned long drm_get_resource_start(drm_device_t *dev, unsigned int resource)
@@ -1653,7 +1654,7 @@ int drm_order(unsigned long size)
 
        for (order = 0, tmp = size >> 1; tmp; tmp >>= 1, order++) ;
 
-       if (size & (size - 1))
+       if (!is_power_of_2(size))
                ++order;
 
        return order;

-- 
Vignesh Babu BM 
_____________________________________________________________ 
"Why is it that every time I'm with you, makes me believe in magic?"


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to