Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b7fc264 authored by Jeremy Gebben's avatar Jeremy Gebben
Browse files

msm: kgsl: fix mem_id_cmp()



Sorting integers is more useful than sorting pointers to integers.

Change-Id: I3091b568fa5daf357b2adaf3e8e68c4945c52aac
Signed-off-by: default avatarJeremy Gebben <jgebben@codeaurora.org>
parent e388465c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3129,8 +3129,9 @@ long kgsl_ioctl_gpumem_sync_cache(struct kgsl_device_private *dev_priv,
static int mem_id_cmp(const void *_a, const void *_b)
{
	const unsigned int *a = _a, *b = _b;
	int cmp = a - b;
	return (cmp < 0) ? -1 : (cmp > 0);
	if (*a == *b)
		return 0;
	return (*a > *b) ? 1 : -1;
}

long kgsl_ioctl_gpumem_sync_cache_bulk(struct kgsl_device_private *dev_priv,
@@ -3165,7 +3166,7 @@ long kgsl_ioctl_gpumem_sync_cache_bulk(struct kgsl_device_private *dev_priv,
		goto end;
	}
	/* sort the ids so we can weed out duplicates */
	sort(id_list, param->count, sizeof(int), mem_id_cmp, NULL);
	sort(id_list, param->count, sizeof(*id_list), mem_id_cmp, NULL);

	for (i = 0; i < param->count; i++) {
		unsigned int cachemode;