summaryrefslogtreecommitdiff
path: root/tools
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 /tools
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 'tools')
-rw-r--r--tools/intel_vbt_decode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 625dc078..b063af84 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -534,10 +534,11 @@ static void dump_child_devices(struct context *context, const uint8_t *devices,
* initialized to zero.
*/
child = calloc(1, sizeof(*child));
+ igt_assert(child);
for (i = 0; i < child_dev_num; i++) {
memcpy(child, devices + i * child_dev_size,
- min(sizeof(*child), child_dev_size));
+ min_t(child_dev_size, sizeof(*child), child_dev_size));
dump_child_device(context, child);
}