mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-26 07:35:44 +08:00
drm/i915/selftests: Fix compare functions provided for sorting
Both cmp_u32 and cmp_u64 are comparing the pointers instead of the value at those pointers. This will result in incorrect/unsorted list. Fix it by deferencing the pointers before comparison. Fixes:4ba74e53ad
("drm/i915/selftests: Verify frequency scaling with RPS") Fixes:8757797ff9
("drm/i915/selftests: Repeat the rps clock frequency measurement") Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20200709154931.23310-1-sudeep.holla@arm.com
This commit is contained in:
parent
3d702d06cb
commit
2196dfea89
@ -29,9 +29,9 @@ static int cmp_u64(const void *A, const void *B)
|
||||
{
|
||||
const u64 *a = A, *b = B;
|
||||
|
||||
if (a < b)
|
||||
if (*a < *b)
|
||||
return -1;
|
||||
else if (a > b)
|
||||
else if (*a > *b)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
@ -41,9 +41,9 @@ static int cmp_u32(const void *A, const void *B)
|
||||
{
|
||||
const u32 *a = A, *b = B;
|
||||
|
||||
if (a < b)
|
||||
if (*a < *b)
|
||||
return -1;
|
||||
else if (a > b)
|
||||
else if (*a > *b)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user