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

* Re: [PATCH] regcache: Use sort()'s default swap() implementation
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2025-04-28  9:00 UTC (permalink / raw)
  To: Thorsten Blum, kernel-janitors
  Cc: LKML, Danilo Krummrich, Greg Kroah-Hartman, Mark Brown,
	Rafael J. Wysocki

…
> +++ b/drivers/base/regmap/regcache.c
>  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);
>  }
…

Would the following source code formatting become applicable?

+	sort(defaults, ndefaults, sizeof(*defaults), regcache_defaults_cmp, NULL);


Regards,
Markus

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

* Re: [PATCH] regcache: Use sort()'s default swap() implementation
  2025-04-28  9:00 ` Markus Elfring
@ 2025-04-30  0:16   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-04-30  0:16 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Thorsten Blum, kernel-janitors, LKML, Danilo Krummrich,
	Greg Kroah-Hartman, Rafael J. Wysocki

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

On Mon, Apr 28, 2025 at 11:00:46AM +0200, Markus Elfring wrote:

> Would the following source code formatting become applicable?
> 
> +	sort(defaults, ndefaults, sizeof(*defaults), regcache_defaults_cmp, NULL);

Feel free to ignore Markus, he has a long history of sending
unhelpful review comments and continues to ignore repeated requests
to stop.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] regcache: Use sort()'s default swap() implementation
  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 23:09 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-04-30 23:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Thorsten Blum
  Cc: linux-kernel

On Mon, 28 Apr 2025 08:13:18 +0200, Thorsten Blum wrote:
> Use sort()'s default swap() implementation and remove the custom
> regcache_defaults_swap() function.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regcache: Use sort()'s default swap() implementation
      commit: d30e845b0ae63400738709ca624a4a7bb69c4ba2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[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.