[Mesa-dev] [PATCH 6/6] anv: drop local MIN/MAX macros.

Dave Airlie airlied at gmail.com
Fri Oct 14 03:16:43 UTC 2016


From: Dave Airlie <airlied at redhat.com>

Use the ones from mesa, most places already did.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/intel/vulkan/anv_image.c   | 2 +-
 src/intel/vulkan/anv_private.h | 5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index f125aa6..b3bc489 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -108,7 +108,7 @@ add_surface(struct anv_image *image, struct anv_surface *surf)
 
    surf->offset = align_u32(image->size, surf->isl.alignment);
    image->size = surf->offset + surf->isl.size;
-   image->alignment = MAX(image->alignment, surf->isl.alignment);
+   image->alignment = MAX2(image->alignment, surf->isl.alignment);
 }
 
 /**
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 5980c40..1685f5b 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -81,9 +81,6 @@ extern "C" {
 #define anv_noreturn __attribute__((__noreturn__))
 #define anv_printflike(a, b) __attribute__((__format__(__printf__, a, b)))
 
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
 static inline uint32_t
 align_down_npot_u32(uint32_t v, uint32_t a)
 {
@@ -125,7 +122,7 @@ anv_minify(uint32_t n, uint32_t levels)
    if (unlikely(n == 0))
       return 0;
    else
-      return MAX(n >> levels, 1);
+      return MAX2(n >> levels, 1);
 }
 
 static inline float
-- 
2.5.5



More information about the mesa-dev mailing list