[v2,5/7] lib/igt_draw: Use igt_bitops

Submitted by Michel Thierry on Feb. 9, 2017, 6:20 p.m.

Details

Message ID 20170209182012.10517-1-michel.thierry@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Michel Thierry Feb. 9, 2017, 6:20 p.m.
Moving bit operations to the new header file.

v2: rename the args for consistency with the other macros (Joonas)

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
---
 lib/igt_bitops.h | 1 +
 lib/igt_draw.c   | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_bitops.h b/lib/igt_bitops.h
index 11e0d8b5..59e8f6ce 100644
--- a/lib/igt_bitops.h
+++ b/lib/igt_bitops.h
@@ -31,6 +31,7 @@ 
 #define BIT_ULL(nr)		(1ULL << (nr))
 #define BITS_PER_CHAR		8
 #define BITS_PER_LONG		(sizeof(long)*BITS_PER_CHAR)
+#define BIT_GET(val, nr)	(((val) >> (nr)) & 1)
 
 static inline unsigned long __bit__(unsigned long nr)
 {
diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 2b321715..3f81161c 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -28,6 +28,7 @@ 
 
 #include "drmtest.h"
 #include "intel_chipset.h"
+#include "igt_bitops.h"
 #include "igt_core.h"
 #include "igt_fb.h"
 #include "ioctl_wrappers.h"
@@ -96,8 +97,6 @@  const char *igt_draw_get_method_name(enum igt_draw_method method)
 	}
 }
 
-#define BIT_GET(num, bit) ((num >> bit) & 1)
-
 static int swizzle_addr(int addr, int swizzle)
 {
 	int bit6;