[Intel-gfx] [PATCH i-g-t 2/8] lib/igt_draw: rename BIT macro to BIT_GET

Michel Thierry michel.thierry at intel.com
Thu Feb 9 02:18:22 UTC 2017


Keeping macros names unique. We'll soon have a bit operations header
file and BIT is already taken.

Signed-off-by: Michel Thierry <michel.thierry at intel.com>
---
 lib/igt_draw.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 3afb8272..2b321715 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -96,7 +96,7 @@ const char *igt_draw_get_method_name(enum igt_draw_method method)
 	}
 }
 
-#define BIT(num, bit) ((num >> bit) & 1)
+#define BIT_GET(num, bit) ((num >> bit) & 1)
 
 static int swizzle_addr(int addr, int swizzle)
 {
@@ -104,20 +104,20 @@ static int swizzle_addr(int addr, int swizzle)
 
 	switch (swizzle) {
 	case I915_BIT_6_SWIZZLE_NONE:
-		bit6 = BIT(addr, 6);
+		bit6 = BIT_GET(addr, 6);
 		break;
 	case I915_BIT_6_SWIZZLE_9:
-		bit6 = BIT(addr, 6) ^ BIT(addr, 9);
+		bit6 = BIT_GET(addr, 6) ^ BIT_GET(addr, 9);
 		break;
 	case I915_BIT_6_SWIZZLE_9_10:
-		bit6 = BIT(addr, 6) ^ BIT(addr, 9) ^ BIT(addr, 10);
+		bit6 = BIT_GET(addr, 6) ^ BIT_GET(addr, 9) ^ BIT_GET(addr, 10);
 		break;
 	case I915_BIT_6_SWIZZLE_9_11:
-		bit6 = BIT(addr, 6) ^ BIT(addr, 9) ^ BIT(addr, 11);
+		bit6 = BIT_GET(addr, 6) ^ BIT_GET(addr, 9) ^ BIT_GET(addr, 11);
 		break;
 	case I915_BIT_6_SWIZZLE_9_10_11:
-		bit6 = BIT(addr, 6) ^ BIT(addr, 9) ^ BIT(addr, 10) ^
-		       BIT(addr, 11);
+		bit6 = BIT_GET(addr, 6) ^ BIT_GET(addr, 9) ^ BIT_GET(addr, 10) ^
+		       BIT_GET(addr, 11);
 		break;
 	case I915_BIT_6_SWIZZLE_UNKNOWN:
 	case I915_BIT_6_SWIZZLE_9_17:
-- 
2.11.0



More information about the Intel-gfx mailing list