is_power_of_2-drm/drm_bufs.c
Subsystems (2)
PATCH 1/1 is_power_of_2-drm/drm_bufs.c
Replacing (n & (n-1)) in the context of power of 2 checks with is_power_of_2
Signed-off-by vignesh babu <[email protected]>
---
drivers/char/drm/drm_bufs.c +2 -1
@@ -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;
Signature · 8 lines
Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?" _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors