aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov2015-09-07 08:13:32 -0500
committerEmil Velikov2015-09-21 11:42:51 -0500
commit6c88173f7ecc2470341ca96e91b6ccb0a5efbef6 (patch)
treed8cddd173b0c3a819886fbe63061e1c1548d31bb /util_math.h
parentbc2aca9e22bf2cc82874f3e44568c684eec9c5e1 (diff)
downloadexternal-libgbm-6c88173f7ecc2470341ca96e91b6ccb0a5efbef6.tar.gz
external-libgbm-6c88173f7ecc2470341ca96e91b6ccb0a5efbef6.tar.xz
external-libgbm-6c88173f7ecc2470341ca96e91b6ccb0a5efbef6.zip
util_math: add MAX3 macro
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'util_math.h')
-rw-r--r--util_math.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/util_math.h b/util_math.h
index 3bc5f644..02b15a8e 100644
--- a/util_math.h
+++ b/util_math.h
@@ -26,6 +26,7 @@
26 26
27#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) ) 27#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
28#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) ) 28#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
29#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
29 30
30#define __align_mask(value, mask) (((value) + (mask)) & ~(mask)) 31#define __align_mask(value, mask) (((value) + (mask)) & ~(mask))
31#define ALIGN(value, alignment) __align_mask(value, (typeof(value))((alignment) - 1)) 32#define ALIGN(value, alignment) __align_mask(value, (typeof(value))((alignment) - 1))