Skip to content

Commit d30e845

Browse files
tobluxbroonie
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0af2f6b commit d30e845

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/base/regmap/regcache.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,10 @@ static int regcache_defaults_cmp(const void *a, const void *b)
3434
return 0;
3535
}
3636

37-
static void regcache_defaults_swap(void *a, void *b, int size)
38-
{
39-
struct reg_default *x = a;
40-
struct reg_default *y = b;
41-
struct reg_default tmp;
42-
43-
tmp = *x;
44-
*x = *y;
45-
*y = tmp;
46-
}
47-
4837
void regcache_sort_defaults(struct reg_default *defaults, unsigned int ndefaults)
4938
{
5039
sort(defaults, ndefaults, sizeof(*defaults),
51-
regcache_defaults_cmp, regcache_defaults_swap);
40+
regcache_defaults_cmp, NULL);
5241
}
5342
EXPORT_SYMBOL_GPL(regcache_sort_defaults);
5443

0 commit comments

Comments
 (0)