From 426723f979380f18f9c07d36ebac3a52f760ba7e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 5 Oct 2021 15:29:35 -0700 Subject: lib: Typechecking minmax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add typechecking to the min/max macros and make their locals truly unique-ish to reduce the risk of shadowing. v2: small bug fix, write also height coordinate on rotation test. (jheikkil) v3: Fix up a couple of other max/max_t instances (Ashutosh) Signed-off-by: Juha-Pekka Heikkilä Signed-off-by: Ashutosh Dixit Signed-off-by: Chris Wilson Reviewed-by: Zbigniew Kempczyński --- lib/intel_allocator_random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/intel_allocator_random.c') diff --git a/lib/intel_allocator_random.c b/lib/intel_allocator_random.c index 9e314261..d22f8176 100644 --- a/lib/intel_allocator_random.c +++ b/lib/intel_allocator_random.c @@ -180,7 +180,7 @@ intel_allocator_random_create(int fd, uint64_t start, uint64_t end) igt_assert(ial->priv); ialr->prng = (uint32_t) to_user_pointer(ial); - start = max(start, BIAS); + start = max_t(uint64_t, start, BIAS); igt_assert(start < end); ialr->start = start; ialr->end = end; -- cgit v1.2.3