summaryrefslogtreecommitdiff
path: root/lib/intel_allocator_random.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2021-10-05 15:29:35 -0700
committerAshutosh Dixit <ashutosh.dixit@intel.com>2021-10-08 19:16:05 -0700
commit426723f979380f18f9c07d36ebac3a52f760ba7e (patch)
treeeefda917ee9bb1bf8b7aefd8c607f4a0d8f4eabb /lib/intel_allocator_random.c
parentd5d99d16817eca9ce8d191b6e84c1a1fe2ad4428 (diff)
lib: Typechecking minmax
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ä <juha-pekka.heikkila@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Chris Wilson <chris.p.wilson@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib/intel_allocator_random.c')
-rw-r--r--lib/intel_allocator_random.c2
1 files changed, 1 insertions, 1 deletions
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;