drm: fix the ALIGN macro to avoid value clamp
If the value is 64bit, but the alignment is 32bit type, the high 32bit will be clamped with previous definition Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>main
parent
95ecf91c7b
commit
90e14d453a
|
@ -27,6 +27,7 @@
|
||||||
#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
|
#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
|
||||||
#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
|
#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
|
||||||
|
|
||||||
#define ALIGN( value, alignment ) ( ((value) + (alignment) - 1) & ~((alignment) - 1) )
|
#define __align_mask(value, mask) (((value) + (mask)) & ~(mask))
|
||||||
|
#define ALIGN(value, alignment) __align_mask(value, (typeof(value))((alignment) - 1))
|
||||||
|
|
||||||
#endif /*_UTIL_MATH_H_*/
|
#endif /*_UTIL_MATH_H_*/
|
||||||
|
|
Loading…
Reference in New Issue