1
0

regcache: Use sort()'s default swap() implementation

Use sort()'s default swap() implementation and remove the custom
regcache_defaults_swap() function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250428061318.88859-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Thorsten Blum
2025-04-28 08:13:18 +02:00
committed by Mark Brown
parent 0af2f6be1b
commit d30e845b0a

View File

@@ -34,21 +34,10 @@ static int regcache_defaults_cmp(const void *a, const void *b)
return 0;
}
static void regcache_defaults_swap(void *a, void *b, int size)
{
struct reg_default *x = a;
struct reg_default *y = b;
struct reg_default tmp;
tmp = *x;
*x = *y;
*y = tmp;
}
void regcache_sort_defaults(struct reg_default *defaults, unsigned int ndefaults)
{
sort(defaults, ndefaults, sizeof(*defaults),
regcache_defaults_cmp, regcache_defaults_swap);
regcache_defaults_cmp, NULL);
}
EXPORT_SYMBOL_GPL(regcache_sort_defaults);