All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regcache: Use sort()'s default swap() implementation
@ 2025-04-28  6:13 Thorsten Blum
  2025-04-28  9:00 ` Markus Elfring
  2025-04-30 23:09 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Thorsten Blum @ 2025-04-28  6:13 UTC (permalink / raw)
  To: Mark Brown, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich
  Cc: Thorsten Blum, linux-kernel

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

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/base/regmap/regcache.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index f7fcf2de1301..c7650fa434ad 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -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);
 
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-30 23:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-28  6:13 [PATCH] regcache: Use sort()'s default swap() implementation Thorsten Blum
2025-04-28  9:00 ` Markus Elfring
2025-04-30  0:16   ` Mark Brown
2025-04-30 23:09 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.