From 9176e27dd275869cdd0a27fcc0403758996496ab Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 16 Dec 2021 11:33:34 -0800 Subject: [PATCH] freedreno: Small dev_id_compare() cleanup We don't really treat the two arguments identically, so rename them to make it clear which one is the device id coming from kernel, and which one is the reference id from the fd_dev_recs table. Signed-off-by: Rob Clark Part-of: --- src/freedreno/common/freedreno_dev_info.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/freedreno/common/freedreno_dev_info.c b/src/freedreno/common/freedreno_dev_info.c index 8b217b3186a..ca27bc433e8 100644 --- a/src/freedreno/common/freedreno_dev_info.c +++ b/src/freedreno/common/freedreno_dev_info.c @@ -36,22 +36,25 @@ struct fd_dev_rec { #include "freedreno_devices.h" +/** + * Compare device 'id' against reference id ('ref') from gpu table. + */ static bool -dev_id_compare(const struct fd_dev_id *a, const struct fd_dev_id *b) +dev_id_compare(const struct fd_dev_id *ref, const struct fd_dev_id *id) { - if (a->gpu_id && b->gpu_id) { - return a->gpu_id == b->gpu_id; + if (ref->gpu_id && id->gpu_id) { + return ref->gpu_id == id->gpu_id; } else { - assert(a->chip_id && b->chip_id); + assert(ref->chip_id && id->chip_id); /* Match on either: * (a) exact match * (b) device table entry has 0xff wildcard patch_id and core/ * major/minor match */ - return (a->chip_id == b->chip_id) || - (((a->chip_id & 0xff) == 0xff) && - ((a->chip_id & UINT64_C(0xffffff00)) == - (b->chip_id & UINT64_C(0xffffff00)))); + return (ref->chip_id == id->chip_id) || + (((ref->chip_id & 0xff) == 0xff) && + ((ref->chip_id & UINT64_C(0xffffff00)) == + (id->chip_id & UINT64_C(0xffffff00)))); } }